body {
    background-color: #333;
    color: #fff;
    font-family: Arial, sans-serif;
    margin: 0px;
}
.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; }

form {
    margin: 0 auto;
}

label {
    display: block;
    margin-top: 5px;
}

input[type="text"], select {
    padding: 5px 4px 5px 4px;
float: right;
width: 122px;
height: 35px;
background-color: #3a3a3a;
color: #ffffff;
font-size: 11px;
border: 1px solid #555;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus, select:focus {
border-color: #777;
outline: none;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 0 2px rgba(255,255,255,0.05);
}
textarea {
background-color: #3a3a3a;
color: #ffffff;
font-size: 11px;
resize: vertical;
border: 1px solid #555;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
textarea:focus {
border-color: #777;
outline: none;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 0 2px rgba(255,255,255,0.05);
}

button {
    padding: 10px 10px;
background-color: #555;
color: #e0e0e0;
border: 1px solid #666;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.2s ease, border-color 0.2s ease;
}
button:hover {
background-color: #666;
border-color: #777;
}

button.selected {
background-color: #999;
color: #000;
}

button.top-selected {
background-color: #999;
color: #000;
}

#resolution {
display: flex;
gap: 0px;
align-items: center;
justify-content: space-around;
max-width: 400px;
width: 300px;
}

.auth-error-message {
    font-size: 14px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
}

#resolution input[type="radio"], 
#resolution label {
display: inline-block; 
margin-right: 5px; /* For some spacing between them */
color: #7e7e7e;
border: 2px solid #545454;
}

input[type="radio"]:checked+label{ color: #ffffff!important; border: 2px solid rgb(147, 147, 147)!important; } 

.res-option {
display: inline-block;
}

.container {
display: flex;
flex-wrap: wrap;
margin: auto;
flex-direction: row;
justify-content: center;
margin: 8px 8px 0px 8px;
}

@media (max-width: 700px) {
.settings, #imageContainer {
    flex: 1 0 100%;
    max-width: 640px;
}
}

@media (min-width: 701px) {
.settings, #imageContainer {
    flex: 1 0 100%;
    max-width: 100%;
}
.settings.half-width, #imageContainer.half-width {
    max-width: 50%;
    margin-right: 0.5rem;
}
}

@media (min-width: 700px) {
    .settings {
        flex: 1;
    }
}

/* Ensure absolute-positioned children (minimize btns, labels) stay within .settings */
.settings {
    position: relative;
}

@media (min-width: 700px) {

#resolution {
display: flex;
gap: 10px;
max-width: 640px;
justify-content: space-evenly;
align-items: center;
width: 400px;
}


}



.prompt {
height: 27px;
width: 60%;
padding-top: 4px;
border-radius: 3px;
font-size: 11px;
}

.generate-button {
position: relative;
overflow: hidden;
float: right;
background: linear-gradient(180deg, #4a5555 0%, #3c4545 100%);
border: 1px solid #566060;
color: #e0e0e0;
transition: background 0.2s ease, border-color 0.2s ease;
}
.generate-button:hover {
background: linear-gradient(180deg, #566060 0%, #4a5555 100%);
border-color: #667070;
}
.generate-button:active {
background: linear-gradient(180deg, #3c4545 0%, #323a3a 100%);
}

/* Disable sparkles style when requested */
body.no-sparkles .sparkle-icon { display: none !important; }
body.no-sparkles .generate-button { padding-right: 10px !important; }

#waveContainer {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
}

.wave {
position: absolute;
border: 2px solid rgba(255, 255, 255, 0.1);
box-sizing: border-box;
width: 200%;
height: 200%;
top: -50%;
left: -50%;
border-radius: 50%;
animation: wave 2s ease-out, blur 2s infinite;
animation-fill-mode: forwards;
background: transparent;
overflow: hidden;
}

.wave-paused {
animation-play-state: paused;
}


.wave:before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
border-radius: 50%;
background: linear-gradient(to right, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
filter: blur(5px);
animation: rotate 2s linear infinite;
}

.wave-green {
animation: wave-green 3s ease-in;
}

@keyframes wave {
0% {
    transform: scale(0);
    opacity: 1;
}
100% {
    transform: scale(1);
    opacity: 0;
}
}

@keyframes blur {
0%, 100% {
    filter: blur(0px);
}
50% {
    filter: blur(2px);
}
}

@keyframes rotate {
0% {
    transform: rotate(0deg);
}
100% {
    transform: rotate(360deg);
}
}

@keyframes wave-green {
0% {

}
100% {
    transform: scale(0);
    opacity: 0;
}
}


.model-select {
    clear: both;
    position: relative;
}

/* Settings modal */
.sa-settings-overlay { display:flex; }
.sa-settings-modal { background:#1e1f24; color:#e5e7eb; border:1px solid #3a3b40; border-radius:10px; width:95%; max-width:820px; box-shadow:0 18px 60px rgba(0,0,0,0.6); }
.sa-settings-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid #363840; }
.sa-settings-close { background:#2a2c33; color:#cbd5e1; border:1px solid #3a3b40; border-radius:8px; padding:6px 10px; cursor:pointer; }
.sa-settings-close:hover { background:#343744; }
.sa-settings-tabs { display:flex; gap:6px; }
.sa-tab-btn { background:#2a2c33; color:#cbd5e1; border:1px solid #3a3b40; border-radius:8px; padding:6px 10px; cursor:pointer; font-weight:600; }
.sa-tab-active { background:#3b3f4a; color:#fff; border-color:#4b5160; }
.sa-settings-body { padding:14px; max-height:70vh; overflow:auto; }
.sa-settings-footer { display:flex; justify-content:flex-end; gap:8px; padding:12px 14px; border-top:1px solid #363840; }
.sa-alert { background:#3a2f19; color:#ffe0a3; border:1px solid #7a5c2a; padding:8px 10px; border-radius:8px; margin-bottom:12px; display:flex; gap:8px; align-items:center; }
.sa-field { margin:10px 0; display:flex; flex-direction:column; gap:6px; }
.sa-label { font-size:12px; color:#cbd5e1; }
.sa-input, .sa-select, .sa-textarea { background:#121318; color:#e5e7eb; border:1px solid #3a3b40; border-radius:8px; padding:8px 10px; }
.sa-textarea { resize: vertical; }
.sa-switch { display:flex; gap:8px; align-items:center; }
.sa-switch input[type="checkbox"] { accent-color:#64748b; width:16px; height:16px; }
.sa-actions { display:flex; align-items:center; gap:10px; }
.sa-actions-stack { display:flex; flex-direction: column; align-items:flex-start; gap:8px; width:100%; margin-top:10px; }
/* Ensure action rows in Account tab stack and never overlap */
#accountSettingsTab .sa-actions { display:block; width:100%; margin-top:8px; }
#accountSettingsTab .sa-actions .sa-btn { display:inline-block; }
#accountSettingsTab .sa-actions-stack { display:block; width:100%; }
#accountSettingsTab .sa-actions-stack .sa-btn { display:inline-block; }
#accountSettingsTab .sa-actions-stack .sa-status { display:block; margin-top:6px; }
/* Robust spacing between preview controls and save row */
#homeBgPreviewContainer { display:block; width:100%; margin-bottom: 14px; }
#homeSaveRow.sa-field { display:block !important; width:100%; clear: both; margin-top: 0; }
/* Lock the background field into an explicit vertical grid so order is guaranteed */
#homeBgField { display: grid !important; grid-template-columns: 1fr; grid-auto-rows: auto; row-gap: 12px; width: 100%; }
#homeBgPreviewContainer, #homeRemoveRow, #homeSaveRow { grid-column: 1; }
#homeRemoveRow, #homeSaveRow { display: block !important; width: 100% !important; }
#homeRemoveRow .sa-btn, #homeSaveRow .sa-btn { display: inline-block; }
.sa-btn { background:#2a2c33; color:#e5e7eb; border:1px solid #3a3b40; border-radius:8px; padding:8px 12px; cursor:pointer; }
.sa-btn:hover { background:#343744; }
.sa-btn-primary { background:#475569; border-color:#64748b; }
.sa-status { font-size:12px; }
.sa-sep { border: none; height:1px; background:#2f313a; margin:12px 0; }

@media (max-width: 786px) {
  .sa-settings-modal { width:96%; max-width:none; border-radius:8px; }
  .sa-settings-body { max-height:70vh; }
}

/* Avatar and background preview helpers */
.sa-bg-preview.hidden { display:none; }
.sa-bg-preview { margin-top:8px; }
.sa-bg-preview-box { position: relative; width: 100%; max-width: 520px; height: 160px; border:1px solid #3a3b40; border-radius:8px; overflow:hidden; background:#121318; }
.sa-bg-preview-box img { position:absolute; top:0; left:0; width:100%; height:auto; user-select:none; cursor:grab; }
.sa-bg-preview-box img.dragging { cursor:grabbing; }
.sa-bg-preview .preview-instructions { position:absolute; right:8px; bottom:8px; font-size:11px; color:#cbd5e1; background:rgba(0,0,0,0.35); padding:4px 8px; border-radius:6px; }

.model-select::before {
    content: "Models:";
    position: absolute;
    top: -20px;
    left: 0;
}

.expandable {
position: relative;
background-color: #333;
cursor: pointer;
text-align: center;
padding-top: 5px;
padding-bottom: 5px;
color: #959595;
font-size: 11px;
border-radius: 5px;
margin-top: 4px;
border: 1px solid #5f5f5f;
}

.expandable:hover {
color: #ccc;

}

.expandable-content {
display: none;
padding: 3px 0px 5px 0px;
background-color: #333;
cursor: default;
color: #959595;
}

.toggleText:hover {
background-color: #222;
cursor: pointer;
}

.expandable:before,
.expandable:after {

position: absolute;
top: 50%;
width: 10px;
height: 2px;
background-color: black;
}

.expandable:before {
left: 10px;

}

.expandable:after {
right: 10px;

}

#topImagesContainer {
overflow: hidden;
/* max-height is set entirely by JS after images render — no CSS default needed
   because the container starts empty (images are fetched via API).
   Transition is also added by JS only during user expand/collapse. */
}

.timePeriodButton {
margin: 0px 5px 2px 0px;
padding: 3px 0px 3px 0px;
width: 30px;
flex-grow: 1;
}

.includecategorie {
margin: 0px 5px 0px 0px;
padding: 3px 0px 3px 0px;
width: 30px;
flex-grow: 1;
}

.modelcategorie {
margin: 5px 5px 0px 0px;
padding: 3px 0px 3px 0px;
flex-grow: 1;
}

#timePeriodButtons {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
}

#includecategories {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
margin-bottom: 5px;
}

#includeextracategories {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
margin-bottom: 5px;
}

#modelcategories {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
}

#topScoreTimePeriodButtons {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
}

#faceDetailerStrength:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes slideUp {
from { opacity: 1; transform: translateY(0); }
to { opacity: 0; transform: translateY(-20px); }
}

@keyframes slideDown {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}

@keyframes expand {
from { max-height: 25px; }
to { max-height: 1000px; }
}

#kSamplerContainer, #img2imgContainer, #resolutionContainer, #advancedPromptContainer, #lorasContainer {
transition: height 0.3s ease, max-height 0.3s ease;
overflow: hidden;
}

#kSamplerContent, #img2imgContent, #resolutionContent, #advancedPromptContent, #lorasContent {
transition: opacity 0.3s ease, transform 0.3s ease;
}

.settings-nodes-container {
    column-width: 200px;
    column-gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 10px auto 0;
}

.grid-item {
    background-color: #444;
    border-radius: 10px;
    padding: 4px;
    break-inside: avoid;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease, max-height 0.3s ease-out;
    outline: none; /* Remove default focus outline */
}

.grid-item[data-state="closed"] {
    max-height: 25px; /* Adjust this value based on your header height */
}
.grid-item[data-state="open"] {
    max-height: 1000px; /* Adjust this value based on your maximum content height */
}

.grid-item:hover {
    background-color: #444;
}

/* Add styles for active state */
.grid-item:active {
    background-color: #555;
}

/* Reset background color after click */
.grid-item:focus {
    background-color: #444;
}

.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #777;
    padding-bottom: 5px;
    margin-bottom: 10px;
    cursor: move;
    user-select: none;
}

.grid-item-controls {
    display: flex;
    align-items: center;
}

.drag-handle-container {
    position: relative;
}

.drag-handle {
    margin-right: 10px;
    color: #dbdbdb;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.grid-item:hover .drag-handle {
    opacity: 1;
}

.tooltip {
    position: fixed;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    z-index: 1000;
    font-size: 12px;
    max-width: 200px; 
    word-wrap: break-word; 
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip.show {
    opacity: 1;
}

.sortable-ghost {
    opacity: 0.5;
    background-color: #666;
}

.sortable-drag {
    opacity: 0.9;
}

@media (max-width: 700px) {
    .settings-nodes-container {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .settings-nodes-container {
        column-count: 2;
        column-gap: 10px;
        column-width: 150px;
    }
}

.fa-chevron-up, .fa-chevron-down {
    padding: 10px;
    margin: -10px;
    cursor: pointer;
}



.model-select-wrapper {
position: relative;
width: 122px;
float: right;
margin-top: 10px;
}

.model-select-dropdown {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 0px 5px 0px;
height: 35px;
background-color: #444444;
color: #ffffff;
font-size: 9px;
cursor: pointer;
box-sizing: border-box;
border: 1px solid #666;
border-radius: 3px;
}

#selectedModelDisplay {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 20px); 
padding-left: 4px;
}

.model-select-dropdown i {
font-size: 12px; 
padding: 10px 15px 10px 0px;
}


.model-select-modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0,0,0,0.4);
}

.model-select-modal-content {
background-color: #333;
margin: 3% auto 5% auto;
padding: 5px;
border: 1px solid #888;
width: 85%;
max-width: 600px;
height: auto;
border-radius: 10px;
}

.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}

.close:hover,
.close:focus {
color: #fff;
text-decoration: none;
}

.model-item {
display: flex;
align-items: flex-start;
padding: 10px;
border-bottom: 1px solid #555;
cursor: pointer;
}

.model-item:hover {
background-color: #444;
}

.model-image {
width: 50px;
height: 50px;
margin-right: 10px;
object-fit: cover;
}

.model-info {
flex-grow: 1;
}

.model-name {
font-weight: bold;
margin-bottom: 5px;
}

.model-description {
font-size: 0.85em;
color: #aaa;
}

.model-source {
    font-size: 0.9em;
color: #abbed7;
text-decoration: none;
}

.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 1px;
padding: 0 5px 10px 5px;
border-bottom: 1px solid #666;
}
.sort-icon {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px; 
}
.sort-label {
    font-size: 0.6em;
    margin-top: 2px;
    text-align: center;
}
.modal-header h2 {
    font-size: 1.2em;
    flex-grow: 1;
    text-align: center;
    margin: 0;
}
.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    text-align: right;
    padding-right: 10px;
}

.model-source-unavailable {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

.model-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.7em;
}

.model-source, .model-source-unavailable {
    margin-right: 10px;
}

.release-dates {
    color: #888;
    display: flex;
    align-items: center;
}

.release-dates i {
    margin-right: 4px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 4px;
    width: 82px;
    height: 129px;
    margin-right: 10px;
    flex-shrink: 0;
}

.thumbnail-grid a {
    display: block;
    width: 100%;
    height: 100%;
}

.model-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}



.lora-select-wrapper {
    position: relative;
    width: 122px;
    float: right;
    margin-top: 10px;
}

.lora-select-dropdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0px 5px 0px;
    height: 35px;
    background-color: #444444;
    color: #ffffff;
    background-color: #333;
    font-size: 9px;
    cursor: pointer;
    box-sizing: border-box;
    border: 1px solid #666;
    border-radius: 3px;
}

/* Keep space on the right for the clear/remove X button */
.lora-selector { position: relative; padding-right: 28px; }
.lora-selector .lora-select-dropdown { width: 100%; }

#selectedLoraDisplay {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 20px); 
    padding-left: 4px;
}

.lora-select-dropdown i {
    font-size: 12px; 
    padding: 10px 15px 10px 0px;
}

.lora-select-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.lora-select-modal-content {
    background-color: #333;
    margin: 3% auto 5% auto;
    padding: 5px;
    border: 1px solid #888;
    width: 85%;
    max-width: 600px;
    height: auto;
    border-radius: 10px;
}

.lora-list {
    overflow-y: auto;
}

.lora-item {
    display: block;
    padding: 10px;
    border-bottom: 1px solid #555;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease, border 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for hover effect */
}


.lora-text-overlay span {
opacity: 1!important;

}

.lora-item:hover .lora-striped-overlay,
.lora-item:hover .lora-text-overlay {
opacity: 1 !important;
}


.lora-item:hover {
    background-color: #555; /* Brighter grey on hover */
}

.lora-thumbnail-container {
width: 80px;
height: 90px;
margin-right: 10px;
overflow: hidden;
position: relative;
flex-shrink: 0;
}

.lora-thumbnail {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

/* Lazy loading container for thumbnails */
.lora-thumbnail-lazy {
    width: 80px;
    height: 90px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* Skeleton loading animation */
.lora-thumbnail-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
}

/* Ensure lazy-loaded thumbnails display correctly */
.lora-thumbnail-lazy .lora-thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.lora-info {
    flex-grow: 1;
    min-width: 0; /* Allow text to wrap */
}

.lora-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lora-description {
    font-size: 0.8em;
    color: #aaa;
    margin-bottom: 5px;
    line-height: 1.5;
}

.lora-description .lora-desc-short {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lora-description .lora-desc-full {
    display: none;
}

.lora-description.expanded .lora-desc-short {
    display: none;
}

.lora-description.expanded .lora-desc-full {
    display: block;
}

.lora-stats {
    font-size: 0.70em;
    color: #909090;
    margin-top: 5px;
    margin-bottom: 0px;
}

.lora-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7em;
    margin-top: 5px;
}

.lora-source {
    font-size: 0.9em;
    color: #abbed7;
    text-decoration: none;
}

.lora-source i {
    margin-right: 4px;
}

.lora-source-unavailable {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

.lora-source-unavailable {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

.release-dates {
    color: #888;
    display: flex;
    align-items: center;
}

.release-dates i {
    margin-right: 4px;
}


.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 1px;
    padding: 0 5px 10px 5px;
    border-bottom: 1px solid #666;
}

.sort-icon {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px; 
}

.sort-label {
    font-size: 0.6em;
    margin-top: 2px;
    text-align: center;
}

.modal-header h2 {
    flex-grow: 1;
    text-align: center;
    margin: 0;
}

.none-thumbnail {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 50px;
    background-color: #363636;
    border-radius: 5px;
}

.none-thumbnail i {
    font-size: 24px;
    color: #999;
}

.lora-lightbox {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.toolbar-item {
    display: flex;
    align-items: center;
    background-color: #444;
    border-radius: 5px;
    padding-left: 5px;
    margin-right: 10px;
    white-space: nowrap;
    margin-bottom: 2px;
}

.toolbar-item i {
    margin-right: 5px;
    color: #fff;
}

.toolbar-item select {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border: 1px solid #5a5a5a;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23b8b8b8' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 100%;
    background-position-y: 50%;
    padding-right: 22px;
    width: auto;
    min-width: 50px;
    height: 30px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.toolbar-item select:hover {
    background-color: #555;
    border-color: #666;
}

.toolbar-item select:focus {
    outline: none;
    border-color: #777;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

.search-container {
    display: flex;
    align-items: center;
}

#imageSearch {
    flex-grow: 1;
    margin-right: 5px;
}

.search-button {
    padding: 8px 10px;
    background-color: #555555;
    color: #eeeeee;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Icon-sized variant for compact buttons (e.g., advanced search gear) */
.search-container .icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 30px; /* align with selects and inputs */
    padding: 0;   /* compact icon button */
    margin-left: 2px; /* spacing after the input */
    margin-right: 6px; /* spacing before the Search button */
}

.search-button:hover {
    background-color: #45a049;
}

.search-button.searching {
    background-color: #FFA500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

#cooldownMessage {
    margin-top: 5px;
}

/* Revert layout change that forced full-width stacking */

.search-container {
    position: relative;
}
.search-result {
    display: flex;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.search-result img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 10px;
}

.image-details {
    font-size: 0.9em;
}

.image-details p {
    margin: 2px 0;
}

#topImagesControls .search-container {
    display: flex;
    align-items: center;
    flex: 1;
}

#topImagesControls .search-container i {
    margin-right: 5px;
}

#topImagesControls #imageSearch {
    width: 100%;
    padding: 5px;
    border: 1px solid #666;
    border-radius: 4px;
    height: 20px;
    font-size: 12px;
}

@media screen and (max-width: 900px) {
    #topImagesControls .search-container {
        width: 100%;
        margin-top: 3px;
    }

    #topImagesControls .controls-row-1,
    #topImagesControls .controls-row-2 {
        flex-wrap: nowrap;
    }

    #topImagesControls .toolbar-item {
        flex: 1;
    }

    #topImagesControls .toolbar-item select {
        width: 100%;
    }
}

    #topImagesControls .toolbar-item {
        display: flex;
        align-items: center;
        margin-right: 10px;
    }

    #topImagesControls .toolbar-item:last-child {
        margin-right: 0;
    }

    #topImagesControls select {
        width: auto;
    }

.pause-interval-container {
    padding: 0;
    overflow: hidden;
    margin-right: 0px;
    height: 30px;
}

#pauseButton {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    height: 35px;
    width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    float: left;
    border-radius: 5px 0 0 5px;
    margin-right: -5px;
}

#pauseButton:hover {
    background-color: #666;
}

#updateInterval {
    border-radius: 0 5px 5px 0;
    float: left;
}







#imageType {
    background-color: #666;
    color: #fff;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 100%;
    background-position-y: 50%;
    padding-right: 20px;
    height: 30px;
}

#imageType:hover {
    background-color: #555;
}

#imageType:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,.25);
}

/* Both containers use grid (set in HTML inline style and JS).
   No !important on display — JS must be able to set display:none */

/* Uniform thumbnail sizing within grid cells */
#recentImagesContainer img, #recentImagesContainer video,
#topImagesContainer img, #topImagesContainer video {
    width: 100% !important;
    object-fit: contain !important;
    box-sizing: border-box;
    display: block;
}

/* Standardize gap */
#recentImagesContainer { gap: 3px !important; }
#topImagesContainer { gap: 3px !important; }

/* Grid cell styling - subtle background for clean contain look */
#recentImagesContainer > div,
#topImagesContainer > div {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: #1a1a1a;
    content-visibility: auto;
    contain-intrinsic-size: auto 70px;
}

@media (max-width: 768px) {
    #recentImagesContainer > div,
    #topImagesContainer > div {
        contain-intrinsic-size: auto 50px;
    }
}

/* Top images toolbar close button */
#retract button {
    background: rgba(170,170,170,0.15);
    color: #aaa;
    border: 1px solid rgba(170,170,170,0.4);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
#retract button:hover {
    background: rgba(170,170,170,0.25);
    border-color: rgba(170,170,170,0.6);
    color: #ccc;
}

/* "Show even more" button styling */
#loadMoreButton {
    background: rgba(170,170,170,0.15) !important;
    color: #aaa !important;
    border: 1px solid rgba(170,170,170,0.4) !important;
    border-radius: 4px !important;
    padding: 4px 14px !important;
    font-size: 13px !important;
    cursor: pointer;
    margin: 8px auto !important;
}
#loadMoreButton:hover {
    background: rgba(170,170,170,0.25) !important;
    color: #ccc !important;
}

/* Toolbar fade support */
#toptoolbar {
    transition: opacity 0.2s ease;
}




#video-dropzone {
    border: 2px dashed #666666;
    border-radius: 5px;
    background-color: #555555;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-direction: column;
}
#video-dropzone:hover {
    background-color: #666666;
}
.dz-message {
    text-align: center;
}
.video-list {
    margin-top: 20px;
}
.video-item {
    background-color: #555555;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.video-name {
    font-weight: bold;
    word-break: break-all;
}
.remove-btn {
background-color: #de5f5f;
color: white;
border: none;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
margin-left: 10px;
}
.video-content {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
.video-thumbnail {
width: 120px;
margin-right: 15px;
margin-bottom: 10px;
flex-shrink: 0;
position: relative;
overflow: hidden;
}

.video-thumbnail video,
.video-thumbnail img {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
}
.video-info {
flex: 1;
min-width: 200px; /* Ensure there's enough width for the input on small screens */
}
.prompt-container {
position: relative;
margin-top: 10px;
min-width: 205px;
}

.prompt-container-smaller {
    position: relative;
    margin-top: 10px;
    width: 32%;
}

.prompt-label {
position: absolute;
top: -1em;
left: -5px;
background-color: #555555;
border: 1px solid #777;
border-radius: 3px;
padding: 0 5px;
font-size: 14px;
color: #cccccc;
z-index: 1;
}

.prompt-input {
width: 100%;
min-height: 40px;
padding: 15px 8px 8px; /* Increased top padding to accommodate label */
border: 1px solid #666666;
border-radius: 5px;
background-color: #666666;
color: #ffffff;
font-size: 15px;
box-sizing: border-box;
resize: none;
overflow-y: hidden;
}

.prompt-input::placeholder {
color: #999999;
}

.loras-input {
width: 100%;
min-height: 20px;
padding: 12px 8px 6px;
border: 1px solid #666666;
border-radius: 5px;
background-color: #666666;
color: #ffffff;
font-size: 1em;
box-sizing: border-box;
resize: vertical;
overflow-y: hidden;
height: 35px;
}

.loras-input::placeholder {
color: #999999;
}

.negative-prompt-input {
width: 100%;
min-height: 40px;
padding: 15px 8px 8px; /* Increased top padding to accommodate label */
border: 1px solid #666666;
border-radius: 5px;
background-color: #666666;
color: #ffffff;
font-size: 1em;
resize: none;
overflow-y: hidden;
box-sizing: border-box;
}
.negative-prompt-input::placeholder {
color: #999999;
}
.error-message {
color: #de5f5f;
margin-top: 5px;
font-size: 14px;
}
.progress-bar {
width: 100%;
background-color: #666666;
height: 20px;
border-radius: 10px;
margin-top: 10px;
overflow: hidden;
}
.progress {
width: 0%;
height: 100%;
background-color: #4CAF50;
transition: width 0.3s ease;
}
.upload-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 14px;
    gap: 10px;
}

.upload-progress-mini {
    flex: 1;
    height: 4px;
    background-color: #666;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-mini {
    height: 100%;
    background: linear-gradient(90deg, 
        #43a047 0%,
        #4caf50 50%,
        #66bb6a 100%
    );
    width: 0;
    transition: width 0.3s ease;
}

.upload-size, .upload-speed {
    flex-shrink: 0;
}
.upload-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background-color: #438947;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.upload-btn:hover {
    background-color: #45a049;
}
#upload-status {
margin-top: 20px;
width: 100%;
}


.upload-result {
background-color: #363636;
border: 2px solid #538656;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upload-result .toggle-info-btn {
width: 100%;
padding: 10px;
background-color: #4d4d4d;
border: 1px solid #555555;
color: white;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
margin-bottom: 10px;
transition: background-color 0.3s;
}


.upload-result .toggle-info-btn:hover {
background-color: #777;
}



.upload-result .additional-info {
border-top: 1px solid #555;
padding-top: 10px;
margin-top: 5px;
}


.upload-result .video-header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #538656;
color: white;
padding: 10px;
border-radius: 5px 5px 0 0;
margin: -20px -20px 15px -20px;
}


.upload-result .video-name {
font-weight: bold;
font-size: 18px;
}

.upload-result .prompt-container {
margin-bottom: 15px;
}

.upload-result .prompt-label {
font-weight: bold;
margin-bottom: 5px;
display: block;
}

.upload-result .prompt-input,
.upload-result .negative-prompt-input,
.upload-result .image-field,
.upload-result .loras-input {
background-color: #444444;
border: 1px solid #555555;
padding: 15px 8px 8px 8px;
border-radius: 5px;
color: #ffffff;
font-size: 14px;
}

.upload-result .result-info {
margin-top: 15px;
font-size: 14px;
color: #cccccc;
}

.upload-result .result-link {
display: inline-block;
margin-top: 10px;
padding: 8px 15px;
background-color: #438947;
color: white;
text-decoration: none;
border-radius: 5px;
font-size: 14px;
transition: background-color 0.3s;
border: solid 1px #438947;
}

.upload-result .result-link:hover {
background-color: #45a049;
}

.upload-result .id-link,
.upload-result .ipid-link {
color: white;
text-decoration: none;
font-weight: bold;
}

.upload-result .id-link:hover,
.upload-result .ipid-link:hover {
text-decoration: underline;
}

.upload-result .thumbnail-link {
display: contents;
}

.upload-result .video-thumbnail {
cursor: pointer;
}
.result-thumbnail {
width: 120px;
height: 67.5px;
background-size: cover;
background-position: center;
margin-right: 15px;
border-radius: 3px;
}
.result-info {
flex-grow: 1;
}
.result-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.result-id {
font-weight: bold;
}
.result-duration, .result-ipid {
font-size: 14px;
color: #cccccc;
}
.result-prompt {
margin-bottom: 10px;
font-style: italic;
}
.result-link {
display: inline-block;
padding: 5px 10px;
background-color: #4CAF50;
color: white;
text-decoration: none;
border-radius: 3px;
font-size: 14px;
transition: background-color 0.3s ease;
}
.result-link:hover {
background-color: #45a049;
}

.image-fields {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 10px;
margin-bottom: 20px;
}




.image-field-upload {
width: 100%!important;
min-height: 40px!important;
padding: 15px 8px 8px!important; /* Increased top padding to accommodate label */
border: 1px solid #666666!important;
border-radius: 5px!important;
background-color: #666666!important;
color: #ffffff!important;
font-size: 0.8em!important;
resize: none!important;
overflow-y: hidden!important;
box-sizing: border-box!important;
}

.image-field-upload::placeholder {
color: #999999!important;
}

.modal-upload {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-upload-content {
    background-color: #444444;
    margin: 5% auto;
    padding: 10px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.closeupload {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    bottom: 4px;
}

.closeupload:hover,
.closeupload:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}


#openModalBtn:hover {
    background-color: #999;
}


@media (max-width: 900px) {
.video-content {
    flex-direction: column;
}
.video-thumbnail {
    width: 100% !important; /* Override any inline styles */
    max-width: none !important; /* Remove any max-width limitations */
    height: auto !important; /* Let height be determined by aspect ratio */
    margin-right: 0;
    position: relative;
}
.video-thumbnail video,
.video-thumbnail img {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 150px;
    object-fit: contain;
}
.video-info {
    width: 100%;
}
.prompt-input {
    height: 80px;
    font-size: 1em;
}
.negative-prompt-input {
    height: 80px;
    font-size: 1em;
}
.prompt-container {
     width: 100%;
}
.prompt-container-smaller {
    width: 100%;
}
}







.img-sequence-btn {
    background: #555;
    color: white;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 5px 0;
    transition: color 0.2s ease;
}

.img-sequence-btn:hover {
    background: #555;
}

.img-sequence-wrapper {
    position: relative;
    display: inline-block;
}

.oldimage-wrapper {
    position: relative;
    width: 32.3%;
    display: inline-block;
}

.oldimage-wrapper img {
    width: 100%;
    display: block;
    max-width: 100%;
    height: auto;
}

.sequence-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px;
    border-radius: 3px;
    min-height: 32px; /* Ensures visibility even with placeholders */
}

.sequence-thumbnails img {
    border-radius: 2px;
    transition: opacity 0.2s ease;
    object-fit: cover;
    aspect-ratio: 1; /* Makes thumbnails square */
}

.sequence-thumbnails img:hover {
    opacity: 0.8;
}

.sequence-thumbnail-placeholder {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    aspect-ratio: 1;
}

.sequence-label {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #444;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
}

.img-sequence-checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #096c63;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.img-sequence-checkbox-main {
    top: 15px;
}


.img-sequence-checkbox-checked {
    background: #00a387;
    color: white;
}

.img-sequence-selectable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.img-sequence-selected {
    outline: 2px solid #00a387;
    box-shadow: 0 0 10px rgba(0, 163, 135, 0.5);
}

.img-sequence-confirm-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #00a387;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    z-index: 1000;
    font-weight: bold;
}

.img-sequence-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.img-sequence-modal-content {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.img-sequence-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.img-sequence-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.img-sequence-modal-buttons button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.img-sequence-save-btn {
    background: #00a387;
    color: white;
    border: none;
}

.img-sequence-cancel-btn {
    background: #666;
    color: white;
    border: none;
}

.img-sequence-item {
    display: flex;
    align-items: center;
    background-color: #444444;
    border-radius: 5px;
    padding: 5px;
    border: 1px solid #777;
}

.img-sequence-grip {
    cursor: move;
    margin-right: 10px;
    color: #888;
}

.img-sequence-number {
    font-weight: bold;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.img-sequence-thumb {
    width: 40px;
    height: 40px;
    overflow: hidden;
    margin-right: 10px;
}

.img-sequence-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-sequence-filename {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8em;
}

.img-sequence-remove-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
}

.average-time i {
    margin-right: 4px;
}

/* Standard and Supporter ETA styling for video models */
.average-time .standard-eta {
    color: #aaa;
}

.average-time .supporter-eta {
    margin-left: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(180, 150, 90, 0.1);
    border: 1px solid rgba(180, 150, 90, 0.25);
    color: #c9a857;
    font-size: 0.9em;
}

.average-time .supporter-eta i {
    color: #b8a050;
    font-size: 0.85em;
    margin-right: 3px;
}

.average-time .supporter-eta:hover {
    background: rgba(180, 150, 90, 0.18);
    border-color: rgba(180, 150, 90, 0.4);
}

#generationTimeDisplay {
    font-family: var(--font-family);
    white-space: nowrap;
}
#generationTimeDisplay i {
    width: 14px;
    text-align: center;
    margin-right: 4px;
}

.time-display-container {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #aaa;
    display: inline-block;
}

.time-display-container i {
    width: 14px;
    text-align: center;
    color: #888;
}

.time-separator {
    margin: 0 8px;
    color: #666;
}

.img-delete-btn {
    background-color: #555;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.img-delete-btn:hover {
    background-color: #c82333;
}


.sso-button.patreon {
    background-color: #F96854;
    color: white;
}

.sso-button.patreon:hover {
    background-color: #E05B47;
}


#welcomePatreonPrompt {
    background: #333333;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: top;
}

#welcomePatreonPrompt.closing {
    transform: scaleY(0);
    opacity: 0;
}

#welcomePatreonPrompt p {
    margin-bottom: 15px;
    color: #ffffff;
}

#welcomePatreonPromptinner {
    background: #333333;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: top;
}

#welcomePatreonPromptinner.closing {
    transform: scaleY(0);
    opacity: 0;
}

#welcomePatreonPromptinner p {
    margin-bottom: 15px;
    color: #ffffff;
}

#welcomePatreonLink {
    margin-bottom: 10px;
    width: 100%;
}

#welcomePatreonSkip {
    width: 100%;
    background: #666;
    color: white;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#welcomePatreonSkip:hover {
    background: #777;
}


    .verification-status {
        background: #333333;
        border-radius: 8px;
        padding: 15px;
        display: flex;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .verification-icon {
        font-size: 24px;
        color: #666;
    }
    
    .verification-text {
        flex: 1;
    }
    
    .verification-text p {
        margin: 0;
        line-height: 1.4;
    }
    
    .verification-checking {
        font-size: 0.9em;
        color: #888;
        margin-top: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .checking-icon {
        color: #666;
    }
    
    .time-remaining {
        color: #666;
        font-size: 0.9em;
    }
    
    .verification-status.verified {
        background: #2a3a2a;
    }
    
    .verification-status.verified .verification-icon {
        color: #4CAF50;
    }
    
    .verification-status.verified .success-message {
        color: #4CAF50;
        margin-top: 5px;
    }
    
    .verification-status.timeout {
        background: #3a2a2a;
    }
    
    .verification-status.timeout .verification-icon {
        color: #f44336;
    }
    
    .retry-button {
        background: #666;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 8px 15px;
        margin-top: 10px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    
    .retry-button:hover {
        background: #777;
    }

    #welcomePatreonLink:hover {
        transform: scale(1.1) !important;
        box-shadow: 0 4px 15px rgba(249, 104, 84, 0.3);
    }
    
    /* Subtle hover effect for skip button */
    #welcomePatreonSkip:hover {
        opacity: 1 !important;
    }


    .sso-options {
        margin-top: 20px;
    }

    .auth-modal .sso-button,
    .auth-modal-content .sso-button,
    #loginTab .sso-button,
    #registerTab .sso-button {
        position: relative;
        padding: 10px 15px 10px 50px;
        margin: 5px 0 10px 0;
        width: 100%;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        text-align: center;
        transition: all 0.3s ease;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        letter-spacing: 0.3px;
        background-color: #555 !important; /* Force override */
        color: #ffffff !important;
    }
    
    /* Provider-specific icon styles with increased specificity */
    .auth-modal .sso-button i,
    .auth-modal-content .sso-button i {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px 0 0 8px;
        font-size: 18px;
        transition: all 0.3s ease;
    }
    
    /* Provider-specific colors with increased specificity */
    .auth-modal .sso-button.discord i,
    .auth-modal-content .sso-button.discord i {
        background-color: #7289DA !important;
    }
    
    .auth-modal .sso-button.patreon i,
    .auth-modal-content .sso-button.patreon i {
        background-color: #F96854 !important;
    }
    
    .auth-modal .sso-button.x i,
    .auth-modal-content .sso-button.x i {
        background-color: #000000 !important;
    }
    
    .auth-modal .sso-button.reddit i,
    .auth-modal-content .sso-button.reddit i {
        background-color: #FF6B4A !important;
    }
    
    /* Hover states with increased specificity */
    .auth-modal .sso-button:hover,
    .auth-modal-content .sso-button:hover {
        background-color: #666 !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        transform: translateY(-1px);
    }
    
    .auth-modal .sso-button:hover i,
    .auth-modal-content .sso-button:hover i {
        width: 45px;
    }
    
    /* Provider hover states */
    .auth-modal .sso-button.discord:hover i,
    .auth-modal-content .sso-button.discord:hover i {
        background-color: #5B6EAF !important;
    }
    
    .auth-modal .sso-button.patreon:hover i,
    .auth-modal-content .sso-button.patreon:hover i {
        background-color: #E05B47 !important;
    }
    
    .auth-modal .sso-button.x:hover i,
    .auth-modal-content .sso-button.x:hover i {
        background-color: #1A1C1E !important;
    }
    
    .auth-modal .sso-button.reddit:hover i,
    .auth-modal-content .sso-button.reddit:hover i {
        background-color: #E65E40 !important;
    }
    
    
    /* Gradient overlay with increased specificity */
    .auth-modal .sso-button::before,
    .auth-modal-content .sso-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(0, 0, 0, 0.02) 100%
        );
        pointer-events: none;
        border-radius: 8px;
    }







    .stufferai-user-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #2a2a2a;
        border-bottom: 1px solid #444;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        max-width: 100%;
    }
    
    .stufferai-user-bar-left {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0; /* Allow shrinking */
        flex: 1; /* Take available space */
        margin-right: 20px; /* Maintain spacing with right side */
    }
    
    .stufferai-user-bar-right {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0; /* Prevent shrinking */
        margin-right: 8px;
    }
    
    .stufferai-profile-link {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        text-decoration: none;
        padding: 3px 6px 3px 8px;
        border-radius: 6px;
        transition: background-color 0.2s;
        min-width: 0; /* Allow shrinking */
        max-width: 100%;
    }

.stufferai-profile-link:hover {
    background-color: #444;
}

.stufferai-profile-link i {
    font-size: 1.2em;
    color: #aaa;
}

.stufferai-username {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Adjust this value based on your needs */
}

.stufferai-user-status {
    color: #dcdcdc;
    font-size: 0.7em;
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 5px;
    padding: 0px 4px 1px 4px;
    margin-top: 1px;
    border: 1px solid #666;
}

.stufferai-notifications-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2em;
    padding: 5px 8px;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.stufferai-notifications-btn:hover {
    background-color: #444;
}

.stufferai-notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #d32f2f;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.stufferai-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    background-color: #6a9643;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.stufferai-login-btn:hover {
    background-color: #45a049;
}

.stufferai-logout-btn {
    background-color: #555;
}

.stufferai-logout-btn:hover {
    background-color: #804949;
}

/* Modal base styles */
.stufferai-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999; /* Ensure it's above other content */
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden; /* Add visibility control */
}

.stufferai-modal.active {
    opacity: 1;
    visibility: visible; /* Show when active */
}

.stufferai-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stufferai-modal.active .stufferai-modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.stufferai-empty-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.stufferai-modal-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stufferai-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 600;
}

.stufferai-modal-actions {
    display: flex;
    gap: 8px;
}

.stufferai-modal-actions button {
    background: none;
    border: none;
    color: #666;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stufferai-modal-actions button:hover {
    background: #333;
    color: #fff;
}

.stufferai-notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.stufferai-notifications-section {
    margin-bottom: 24px;
}

.stufferai-notifications-section-title {
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stufferai-notification-item {
    position: relative;
    margin: 8px 0;
    padding: 16px;
    background: #222;
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #4CAF50;
}

.stufferai-notification-item:hover {
    background: #2a2a2a;
    transform: translateX(4px);
}

.stufferai-notification-item.unread {
    background: #1a1a1a;
}

.stufferai-notification-header {
    margin-bottom: 8px;
}

.stufferai-notification-title {
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}


.stufferai-notification-content {
    color: #bbb;
    line-height: 1.5;
    margin-bottom: 12px;
}

.stufferai-notification-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.stufferai-notification-time {
    color: #666;
}

.stufferai-notification-actions {
    display: flex;
    gap: 8px;
}

.stufferai-notification-action {
    background: none;
    border: none;
    padding: 6px;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stufferai-notification-action:hover {
    background: #333;
    color: #fff;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Empty state styling */
.stufferai-notifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.stufferai-notifications-empty i {
    font-size: 2rem;
    margin-bottom: 16px;
}

/* Custom scrollbar */
.stufferai-notifications-list::-webkit-scrollbar {
    width: 8px;
}

.stufferai-notifications-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.stufferai-notifications-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.stufferai-notifications-list::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.stufferai-notification-time {
    color: #888;
    font-size: 0.8em;
}

.stufferai-notification-dismiss {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 768px) {
    
    .stufferai-username {
        max-width: 200px; /* Smaller on mobile */
    }
    
    .stufferai-user-status {
        max-width: 120px; /* Limit status width on mobile */
    }
    
    .stufferai-login-btn span {
        display: none; /* Hide login text on mobile, show only icon */
    }
}

@media (max-width: 480px) {
    .stufferai-username {
        max-width: 150px; /* Even smaller on very small screens */
    }
    
    .stufferai-user-status {
        max-width: 120px;
    }
}




/* Notification style */



.stufferai-notification-count {
    background: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
}

.stufferai-empty-icon {
    position: relative;
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stufferai-empty-icon i {
    font-size: 32px;
    color: #666;
}

.stufferai-empty-icon i.fa-check {
    position: absolute;
    right: -5px;
    bottom: -5px;
    font-size: 24px;
    background: #4CAF50;
    color: white;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.stufferai-notification-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-left: 8px;
}

.stufferai-notification-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stufferai-notifications-empty h3 {
    color: #fff;
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.stufferai-notifications-empty p {
    color: #666;
    margin: 0 0 20px;
}

.stufferai-refresh-btn {
    background: #333;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.stufferai-refresh-btn:hover {
    background: #444;
    transform: translateY(-1px);
}

.stufferai-refresh-btn i {
    font-size: 14px;
}

.stufferai-refresh-btn:active i {
    animation: spin 0.5s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stufferai-notification-item {
    padding: 15px;
    border-bottom: 1px solid #444;
    background-color: #2a2a2a;
    transition: background-color 0.2s;
}

.stufferai-notification-item.unread {
    background-color: #1a1a1a;
}

.stufferai-notification-item:hover {
    background-color: #333;
}

.stufferai-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.stufferai-notification-title {
    color: #fff;
    font-weight: 500;
}

.stufferai-notification-type {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stufferai-notification-type i {
    font-size: 12px;
}

.stufferai-refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

.stufferai-notification-content {
    color: #bbb;
    margin-bottom: 8px;
    line-height: 1.4;
}

.stufferai-notification-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stufferai-notification-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
}

.stufferai-notification-time i {
    font-size: 12px;
}

.stufferai-notification-actions {
    display: flex;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
}


.stufferai-notification-action {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9em;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.stufferai-notification-action:hover {
    background-color: #444;
    color: #fff;
}

.stufferai-preferences-button {
    position: absolute;
    top: 20px;
    right: 50px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.stufferai-preferences-button:hover {
    color: #fff;
    background-color: #444;
}

.stufferai-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stufferai-preferences-content {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stufferai-preferences-modal.active .stufferai-preferences-content {
    transform: translateY(0);
}

.stufferai-preferences-modal.active {
    opacity: 1;
}

.stufferai-preferences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stufferai-preferences-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.stufferai-preferences-header .stufferai-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.stufferai-preferences-header .stufferai-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stufferai-preferences-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.stufferai-preferences-list::-webkit-scrollbar {
    width: 8px;
}

.stufferai-preferences-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.stufferai-preferences-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.stufferai-preferences-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
    

    .stufferai-preference-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .stufferai-preference-item:last-child {
        border-bottom: none;
    }

    .stufferai-preference-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .stufferai-preference-info i {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        color: #fff;
        font-size: 0.9rem;
    }
    
    .stufferai-preference-label {
        color: #fff;
        font-size: 0.95rem;
    }
    
    .stufferai-preference-toggle {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
    }

.stufferai-preference-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stufferai-preference-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 34px;
}

.stufferai-preference-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}

.stufferai-preference-toggle input:checked + .stufferai-preference-slider {
    background-color: #2196F3;
}

.stufferai-preference-toggle input:checked + .stufferai-preference-slider:before {
    transform: translateX(20px);
}

/* Hover effects */
.stufferai-preference-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stufferai-preference-toggle:hover .stufferai-preference-slider {
    box-shadow: 0 0 1px #2196F3;
}

/* Focus styles for accessibility */
.stufferai-preference-toggle input:focus + .stufferai-preference-slider {
    box-shadow: 0 0 1px #2196F3;
}

/* Active/pressed state */
.stufferai-preference-toggle:active .stufferai-preference-slider:before {
    width: 20px;
}




.stufferai-notifications-badge.pulse {
    animation: badge-pulse 1s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.stufferai-notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1a;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    animation: toast-slide-in 0.3s ease;
}

.stufferai-notification-toast.fade-out {
    animation: toast-slide-out 0.3s ease forwards;
}

.stufferai-notification-toast i {
    color: #4CAF50;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* End of notification style */


.closing-animation {
    animation: slideUpFade 0.3s ease forwards;
    transform-origin: top;
}

@keyframes slideUpFade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
        margin: 0;
        padding: 0;
        height: 0;
    }
}







.flux-login-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.flux-login-modal.show {
    opacity: 1;
}

.flux-login-modal-content {
    background: linear-gradient(145deg, #2d2d2d, #393939);
    margin: 15% auto;
    padding: 20px;
    border: none;
    border: 1px solid #555;
    width: 350px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flux-login-modal.show .flux-login-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.flux-login-modal h2 {
    color: #fff;
    margin-bottom: 15px;
    margin-top: 0px;
    font-size: 24px;
    font-weight: 600;
}

.flux-login-modal p {
    color: #ddd;
    margin-bottom: 25px;
    line-height: 1.5;
    font-size: 16px;
}

.flux-login-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.flux-login-btn, .flux-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flux-login-btn:hover, .flux-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.flux-login-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.flux-login-btn:hover {
    background: linear-gradient(135deg, #45a049, #409444);
}

.flux-cancel-btn {
    background: transparent;
    color: #ddd;
    border: 1px solid #ddd;
}

.flux-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Qwen Edit Login Modal */
.qwen-edit-login-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.qwen-edit-login-modal.show {
    opacity: 1;
}

.qwen-edit-login-modal-content {
    background: linear-gradient(145deg, #2d2d2d, #393939);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #555;
    width: 350px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qwen-edit-login-modal.show .qwen-edit-login-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.qwen-edit-login-modal h2 {
    color: #fff;
    margin-bottom: 15px;
    margin-top: 0px;
    font-size: 24px;
    font-weight: 600;
}

.qwen-edit-login-modal p {
    color: #ddd;
    margin-bottom: 25px;
    line-height: 1.5;
    font-size: 16px;
}

.qwen-edit-login-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.qwen-edit-login-btn, .qwen-edit-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qwen-edit-login-btn:hover, .qwen-edit-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.qwen-edit-login-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.qwen-edit-login-btn:hover {
    background: linear-gradient(135deg, #45a049, #409444);
}

.qwen-edit-cancel-btn {
    background: transparent;
    color: #ddd;
    border: 1px solid #ddd;
}

.qwen-edit-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Toggle switch styles for premium settings */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border: 1px solid #666;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #aaa;
    transition: .3s;
}

input:checked + .slider {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: white;
}

input:disabled + .slider {
    cursor: not-allowed;
    opacity: 0.5;
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Premium settings specific styles */
#supporterExtrasContainer {
    position: relative;
}

#supporterExtrasContainer.non-premium #supporterExtrasContent {
    opacity: 0.5;
}

/* --- Compact Video Status UI --- */
.video-status {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(40,40,40,0.9);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.2;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* clip any accidental overflow */
}
.video-status > * { min-width: 0; }
.video-status .vs-head, .video-status .vs-subwrap, .video-status .vs-body, .video-status .vs-minline { min-width: 0; }
.video-status .vs-title { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-status .vs-head { display: flex; align-items: center; justify-content: space-between; }
.video-status .vs-title { font-weight: 600; font-size: 13px; color: #f0f0f0; }
.video-status .vs-title { display: flex; align-items: center; gap: 6px; }
.video-status .vs-title .vs-ico { color: #a5d6ff; }
.video-status .vs-title .vs-loader-head { margin-left: 4px; }
.video-status.failed { border-color: rgba(244, 67, 54, 0.35); background: rgba(244, 67, 54, 0.08); }
.video-status.failed .vs-title { color: #ff8a80; }
.video-status.failed .vs-title .vs-ico { color: #ff8a80; }
.video-status .vs-title .vs-loader-head .dot { width: 5px; height: 5px; }
.video-status .vs-actions { display: flex; gap: 6px; }
.video-status .vs-btn {
  background: transparent; color: #bbb; border: 1px solid #555; border-radius: 4px;
  padding: 0 6px; height: 20px; line-height: 18px; cursor: pointer; font-size: 14px;
}
.video-status .vs-btn.vs-min { background: rgba(255, 213, 79, 0.15); border-color: rgba(255, 213, 79, 0.4); color: #ffd54f; }
.video-status .vs-btn.vs-min:hover { background: rgba(255, 213, 79, 0.25); border-color: rgba(255, 213, 79, 0.6); }
.video-status .vs-btn.vs-close { background: rgba(244, 67, 54, 0.15); border-color: rgba(244, 67, 54, 0.4); color: #ff8a80; }
.video-status .vs-btn.vs-close:hover { background: rgba(244, 67, 54, 0.25); border-color: rgba(244, 67, 54, 0.6); }
.video-status .vs-btn:hover { color: #fff; border-color: #888; }
.video-status .vs-subwrap { color: #bdbdbd; }
.video-status .vs-sub { color: #9e9e9e; }
.video-status .vs-body { display: flex; flex-direction: column; gap: 6px; }
.video-status .vs-minline { display: none; align-items: center; justify-content: space-between; gap: 10px; }
.video-status .vs-minline .vs-mintext { color: #dcdcdc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-status .vs-line { color: #dcdcdc; }
.video-status .vs-failed { display: flex; flex-direction: column; gap: 8px; }
.video-status .vs-failed-message { color: #ff8a80; font-weight: 600; }
.video-status .vs-failed-hint { color: #ffcdd2; font-size: 12px; }
.video-status .vs-tip-failed { color: #ffcdd2; }
.video-status .vs-lora-warning {
  background: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.4);
  border-radius: 6px;
  padding: 8px 10px;
  color: #ffcc80;
  font-size: 12px;
  line-height: 1.4;
}
.video-status .vs-lora-warning i { margin-right: 6px; color: #ffa726; }
.video-status .vs-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #5cb85c, #4a9a4a);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
  margin-top: 4px;
}
.video-status .vs-retry-btn:hover {
  background: linear-gradient(135deg, #6cc96c, #5aaa5a);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(92, 184, 92, 0.3);
}
.video-status .vs-retry-btn:active {
  transform: translateY(0);
}
.video-status .vs-retry-btn i { font-size: 11px; }
.video-status .vs-queue-alt { color: #b0b0b0; font-size: 11px; margin-left: 6px; }
.video-status .vs-loader { display: inline-flex; gap: 4px; align-items: center; height: 10px; }
.video-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #6cc070; opacity: 0.6;
  animation: vs-pulse 1.2s infinite ease-in-out;
}
.video-status .dot:nth-child(2) { animation-delay: 0.2s; }
.video-status .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vs-pulse { 0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; } 40% { transform: scale(1.1); opacity: 1; } }

.video-status .vs-bar { position: relative; height: 6px; background: #3b3b3b; border-radius: 4px; overflow: hidden; }
.video-status .vs-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg,#5cb85c,#79d07a); transition: width 0.3s ease; }

.video-status .vs-complete {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.video-status .vs-complete-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
}
.video-status .vs-thumb video { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; border: 1px solid #555; }
.video-status .vs-link { color: #69d28a; text-decoration: none; border: 1px solid #4a8a5d; padding: 6px 10px; border-radius: 5px; }
.video-status .vs-link:hover { border-color: #69d28a; }
.video-status .vs-complete-current {
  opacity: 0;
  transform: translateY(12px);
  animation: vsCompleteIn 0.32s ease forwards;
}
.video-status .vs-complete-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 10px;
}
.video-status .vs-complete-prompt-single {
  color: #b8b8b8;
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
  margin-top: 2px;
}

@keyframes vsCompleteIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.video-status .vs-prompt {
  color: #9e9e9e;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* force single line with robust ellipsis */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal; /* allow measuring without expanding layout */
  word-break: break-word;
  overflow-wrap: anywhere;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Ensure minimized single-line text never overflows */
.video-status .vs-minline .vs-mintext {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-status .vs-tip { color: #b0b0b0; font-size: 11px; margin-top: 2px; }
.video-status.minimized .vs-tip { display: none; }
.video-status .vs-min-thumb video { width: 24px; height: 24px; border-radius: 4px; vertical-align: middle; border: 1px solid #555; margin-right: 6px; }
.video-status .vs-link-min { color: #69d28a; text-decoration: none; border: 1px solid #4a8a5d; padding: 2px 6px; border-radius: 4px; }
.video-status .vs-link-min:hover { border-color: #69d28a; }

/* Minimized to a thin bar */
.video-status.minimized .vs-head, .video-status.minimized .vs-subwrap, .video-status.minimized .vs-body, .video-status.minimized .vs-prompt { display: none; }
.video-status.minimized .vs-minline { display: flex; }
.video-status.minimized { padding: 6px 10px; }
.video-status.minimized .vs-title { font-size: 12px; }
.video-status.minimized .vs-subwrap { color: #9e9e9e; font-size: 11px; }

/* Extra compact on mobile */
@media (max-width: 700px) {
  .video-status { padding: 8px 10px; font-size: 11px; }
  .video-status .vs-title { font-size: 12px; }
  .video-status .vs-btn { height: 18px; line-height: 16px; padding: 0 5px; font-size: 12px; }
  .video-status .vs-thumb video { width: 56px; height: 56px; }
}

.video-status .vs-automation {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.video-status .vs-automation.locked {
  opacity: 0.75;
}
.video-status .vs-automation-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: #f8eaae;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  border-radius: 6px;
  z-index: 2;
  overflow: hidden;
}
.video-status .vs-automation-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.18) 0px, rgba(0, 0, 0, 0.18) 12px, rgb(62 61 45 / 32%) 12px, rgb(73 69 55 / 32%) 24px);
  opacity: 0.85;
}
.video-status .vs-automation-overlay-message {
  display: inline-block;
  position: relative;
  z-index: 1;
  background: rgba(12, 12, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: #ffeac2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.video-status .vs-auto-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.video-status .vs-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
}
.video-status .vs-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.video-status .vs-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: background 0.2s ease;
}
.video-status .vs-switch-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #111;
  transition: transform 0.2s ease;
}
.video-status .vs-switch input:checked + .vs-switch-slider {
  background: #69d28a;
}
.video-status .vs-switch input:checked + .vs-switch-slider::before {
  transform: translateX(18px);
  background: #0b1a11;
}
.video-status .vs-switch input:disabled + .vs-switch-slider {
  opacity: 0.4;
  cursor: not-allowed;
}
.video-status .vs-auto-label {
  color: #f0f0f0;
  font-weight: 500;
  font-size: 12px;
}
.video-status .vs-auto-count {
  background: #121212;
  color: #dedede;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}
.video-status .vs-auto-count:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.video-status .vs-auto-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #f6f6f6;
  background: rgba(105, 210, 138, 0.1);
  border: 1px solid rgba(105, 210, 138, 0.35);
  border-radius: 4px;
  padding: 6px 8px;
}
.video-status .vs-auto-status-text {
  font-weight: 600;
  letter-spacing: 0.4px;
}
.video-status .vs-auto-subline {
  color: #b0b0b0;
  font-size: 11px;
}
.video-status .vs-auto-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #dcdcdc;
  font-size: 12px;
}
.video-status .vs-queue-title {
  font-weight: 600;
}
.video-status .vs-btn.vs-queue-clear {
  border-color: rgba(255,255,255,0.15);
  color: #bdbdbd;
  font-size: 11px;
  padding: 0 8px;
}
.video-status .vs-auto-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.video-status .vs-auto-queue-item {
  display: grid;
  grid-template-columns: 16px 1fr 18px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255,255,255,0.05);
  cursor: grab;
}
.video-status .vs-auto-queue-item.dragging {
  opacity: 0.6;
}
.video-status .vs-auto-queue-item.drag-over {
  border-color: rgba(105,210,138,0.45);
  background: rgba(105,210,138,0.12);
}
.video-status .vs-auto-queue-empty {
  color: #9a9a9a;
  font-size: 11px;
  padding: 6px 4px;
}
.video-status .vs-queue-handle {
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-status .vs-queue-text {
  color: #dedede;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-status .vs-queue-remove {
  background: rgba(244, 67, 54, 0.2);
  border: none;
  color: #ff8a80;
  border-radius: 4px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.video-status .vs-queue-remove:hover {
  background: rgba(244, 67, 54, 0.35);
}
.video-status .vs-auto-queue-message {
  font-size: 11px;
  color: #c6c6c6;
  margin-top: 2px;
}
.video-status .vs-auto-queue-message[data-type="warn"] {
  color: #f5a45d;
}
.video-status .vs-complete-list-wrap {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 6px;
  margin-top: 8px;
}
.video-status .vs-complete-list-wrap.collapsed {
  padding-bottom: 4px;
}
.video-status .vs-complete-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.video-status .vs-complete-list-title {
  font-size: 11px;
  font-weight: 600;
  color: #d2f1de;
}
.video-status .vs-history-toggle {
  border-color: rgba(255,255,255,0.15);
  color: #bdbdbd;
  font-size: 11px;
  padding: 0 8px;
  height: 20px;
  line-height: 18px;
}
.video-status .vs-complete-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.video-status .vs-complete-list-wrap.collapsed .vs-complete-list {
  display: none;
}
.video-status .vs-complete-item {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  padding: 4px 6px;
}
.video-status .vs-complete-thumb {
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.video-status .vs-complete-thumb video {
  width: 48px;
  height: 48px;
  object-fit: cover;
}
.video-status .vs-complete-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.video-status .vs-complete-link {
  color: #69d28a;
  font-size: 12px;
  text-decoration: none;
}
.video-status .vs-complete-link:hover {
  text-decoration: underline;
}
.video-status .vs-complete-prompt {
  color: #adadad;
  font-size: 11px;
  line-height: 1.2;
  word-break: break-word;
}

/* ===========================================
   Server Status Bar - Expandable Design
   =========================================== */
.server-status-bar {
  background: #2f2f2f;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  border: 1px solid #3a3a3a;
  transition: background-color 0.2s ease;
  user-select: none;
}
.server-status-bar:hover {
  background: #323232;
}
.server-status-bar .expand-icon {
  margin-left: auto;
  color: #888;
  transition: transform 0.2s ease;
}
.server-status-bar.expanded .expand-icon {
  transform: rotate(180deg);
}
.status-group {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #b8b8b8;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.status-online { background: #5cb85c; }
.status-dot.status-offline { background: #d9534f; }
.status-dot.status-partial { background: #f0ad4e; }

.server-status-expanded {
  display: none;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 10px 12px;
  margin-top: -4px;
}
.server-status-expanded.show {
  display: block;
}
.gpu-category {
  margin-bottom: 10px;
}
.gpu-category:last-child {
  margin-bottom: 0;
}
.category-header {
  font-weight: 600;
  color: #999;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #3a3a3a;
}
.gpu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 11px;
}
.gpu-name {
  color: #ccc;
  min-width: 100px;
}
.gpu-stats {
  color: #888;
  font-size: 10px;
}
.queue-totals {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #3a3a3a;
  font-size: 10px;
  color: #888;
}

/* Video Queue Stats Section */
.vq-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.vq-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #999;
}
.vq-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vq-stat-dot.i2v { background: #aa66ff; }
.vq-stat-dot.t2v { background: #00d4ff; }
.vq-stat-dot.vip { background: #ffd700; }
.vq-stat-dot.anima { background: #ff8a00; }
.vq-stat-dot.zimg { background: #ff5f87; }
.vq-stat-dot.qimg { background: #00c9a7; }
.vq-stat-dot.qedit { background: #4da3ff; }
.vq-stat-dot.std { background: #666; }
.vq-stat-value {
  color: #ccc;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.vq-eta-row {
  display: flex;
  gap: 12px;
  font-size: 10px;
  padding: 6px 0;
  border-top: 1px solid #3a3a3a;
}
.vq-eta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vq-eta-label {
  color: #666;
}
.vq-eta-value {
  color: #00d4ff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.vq-eta-value.vip {
  color: #ffd700;
}
.vq-workers-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #3a3a3a;
  font-size: 10px;
  color: #888;
}
.vq-worker-dots {
  display: flex;
  gap: 4px;
}
.vq-worker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #444;
  background: #333;
  position: relative;
}
.vq-worker-dot.idle {
  background: #555;
  border-color: #666;
}
.vq-worker-dot.busy {
  background: #00d4ff;
  border-color: #00a8cc;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
  animation: worker-spin 1.2s linear infinite;
}
.vq-worker-dot.offline {
  background: #d9534f;
  border-color: #c9433f;
}
@keyframes worker-spin {
  0% { box-shadow: 0 0 4px rgba(0, 212, 255, 0.4); }
  50% { box-shadow: 0 0 8px rgba(0, 212, 255, 0.8); }
  100% { box-shadow: 0 0 4px rgba(0, 212, 255, 0.4); }
}
.vq-worker-dot::after {
  content: attr(data-label);
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: #666;
  white-space: nowrap;
}

/* Compact Queue List */
.vq-list {
  max-height: 120px;
  overflow-y: auto;
}
.vq-list::-webkit-scrollbar {
  width: 4px;
}
.vq-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}
.vq-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 10px;
  border-bottom: 1px solid #333;
}
.vq-list-item:last-child {
  border-bottom: none;
}
.vq-pos {
  color: #00d4ff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  min-width: 18px;
}
.vq-pos.top3 {
  color: #ffd700;
}
.vq-user {
  flex: 1;
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vq-badge {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}
.vq-badge.vip {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.vq-badge.i2v {
  background: rgba(170, 102, 255, 0.2);
  color: #aa66ff;
  border: 1px solid rgba(170, 102, 255, 0.3);
}
.vq-badge.t2v {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.3);
}
.vq-badge.anima {
  background: rgba(255, 138, 0, 0.2);
  color: #ffb85c;
  border: 1px solid rgba(255, 138, 0, 0.35);
}
.vq-badge.zimg {
  background: rgba(255, 95, 135, 0.2);
  color: #ff9fba;
  border: 1px solid rgba(255, 95, 135, 0.35);
}
.vq-badge.qimg {
  background: rgba(0, 201, 167, 0.2);
  color: #66efd6;
  border: 1px solid rgba(0, 201, 167, 0.35);
}
.vq-badge.qedit {
  background: rgba(77, 163, 255, 0.2);
  color: #8ec2ff;
  border: 1px solid rgba(77, 163, 255, 0.35);
}
.vq-wait {
  color: #666;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
}
.vq-wait.long {
  color: #f0ad4e;
}
.vq-wait.critical {
  color: #d9534f;
}
.vq-more {
  text-align: center;
  padding: 4px;
  color: #555;
  font-size: 9px;
  cursor: pointer;
}
.vq-more:hover {
  color: #888;
}
.vq-more a {
  color: #00d4ff;
  text-decoration: none;
}
.vq-more a:hover {
  text-decoration: underline;
}

/* ===========================================
   Thumbnail Size Controls
   =========================================== */
.thumbnail-size-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #444;
  border-radius: 5px;
  padding: 2px 4px;
  border: 1px solid #555;
}
.thumbnail-size-controls .size-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: #555;
  border: 1px solid #666;
  color: #ddd;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.thumbnail-size-controls .size-btn:hover {
  background: #666;
}
.thumbnail-size-controls .size-btn:active {
  background: #555;
}
.thumbnail-size-controls .size-display {
  min-width: 42px;
  text-align: center;
  font-size: 11px;
  color: #ccc;
  padding: 0 4px;
}
.thumbnail-size-controls .cols-display {
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  color: #ccc;
  padding: 0 2px;
}
/* Responsive visibility for thumbnail controls */
.thumbnail-size-controls.desktop-only { display: flex !important; }
.thumbnail-size-controls.mobile-only { display: none !important; }
@media (max-width: 700px) {
  .thumbnail-size-controls.desktop-only { display: none !important; }
  .thumbnail-size-controls.mobile-only { display: flex !important; }
}

/* Top toolbar thumbnail size controls */
#topthumbnailSizeToolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}
#topthumbnailSizeToolbar > i {
  color: #aaa;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Premium Upscale Toggle - I2V Feature
   ═══════════════════════════════════════════════════════════════════════════ */

#upscaleRow {
    display: none;
    margin: 4px 0 14px 0;
}

#upscaleRow .upscale-feature {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(55, 55, 60, 0.9) 0%, rgba(40, 40, 45, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

#upscaleRow .upscale-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Toggle Switch */
#upscaleRow .upscale-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

#upscaleRow .upscale-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

#upscaleRow .upscale-track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#upscaleRow .upscale-thumb {
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    top: 2px;
    border-radius: 50%;
    background: #888;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Checked State */
#upscaleRow .upscale-toggle input:checked + .upscale-track {
    background: linear-gradient(135deg, #2d7a3a 0%, #3d9a4a 100%);
    border-color: rgba(105, 210, 138, 0.3);
    box-shadow: 0 0 12px rgba(105, 210, 138, 0.25);
}

#upscaleRow .upscale-toggle input:checked + .upscale-track .upscale-thumb {
    transform: translateX(18px);
    background: #fff;
    box-shadow: 0 0 8px rgba(105, 210, 138, 0.5);
}

/* Disabled State */
#upscaleRow .upscale-toggle input:disabled + .upscale-track {
    opacity: 0.35;
    cursor: not-allowed;
}

#upscaleRow .upscale-toggle input:disabled + .upscale-track .upscale-thumb {
    background: #555;
}

/* Label Group */
#upscaleRow .upscale-label-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#upscaleRow .upscale-label {
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e0;
    letter-spacing: 0.02em;
}

#upscaleRow .upscale-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 5px;
    border-radius: 4px;
    background: linear-gradient(135deg, #4a4a50 0%, #3a3a40 100%);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

/* Badge glow when active */
#upscaleRow:has(.upscale-toggle input:checked) .upscale-badge {
    background: linear-gradient(135deg, #2d7a3a 0%, #3d9a4a 100%);
    color: #fff;
    border-color: rgba(105, 210, 138, 0.4);
    box-shadow: 0 0 8px rgba(105, 210, 138, 0.3);
}

/* Disabled states */
#upscaleRow:has(.upscale-toggle input:disabled) .upscale-label {
    color: #666;
}

#upscaleRow:has(.upscale-toggle input:disabled) .upscale-badge {
    opacity: 0.4;
}

#upscaleRow:has(.upscale-toggle input:disabled) .upscale-feature {
    opacity: 0.7;
}

/* Note for non-supporters */
#upscaleRow .upscale-note {
    flex-basis: 100%;
    font-size: 10px;
    color: #ff8888;
    font-style: italic;
    opacity: 0.9;
    margin-top: -2px;
    padding-left: 48px;
}

#upscaleRow .upscale-note:empty {
    display: none;
}

/* ===========================================
   Thumbnail Entry Animations
   =========================================== */

@keyframes thumbnailFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.thumbnail-entering {
    animation: thumbnailFadeIn 180ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
    opacity: 0;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .thumbnail-entering {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ===========================================
   Section Minimize Buttons (Top/Recent Images)
   =========================================== */
.section-min-btn {
  background: rgba(170, 170, 170, 0.15);
  color: #aaa;
  border: 1px solid rgba(170, 170, 170, 0.4);
  border-radius: 4px;
  padding: 0 6px;
  height: 18px;
  line-height: 16px;
  cursor: pointer;
  font-size: 12px;
  position: absolute;
  right: 0;
  z-index: 3;
}

#topImagesMinBtn {
  margin-top: 3px;
}

#recentImagesMinBtn {
  margin-top: 5px;
}

.section-min-btn:hover {
  background: rgba(170, 170, 170, 0.25);
  border-color: rgba(170, 170, 170, 0.6);
  color: #ccc;
}

#topImagesContainer.minimized,
#recentImagesContainer.minimized {
  display: none !important;
}

/* Labels and buttons become relative positioned when minimized to stack vertically */
#topImagesLabel.section-minimized {
  position: relative !important;
  display: inline-block !important;
  margin-left: 0 !important;
  margin-top: 5px !important;
}

#topImagesMinBtn.section-minimized {
  position: relative !important;
  display: inline-block !important;
  margin-top: 0 !important;
  margin-left: 8px;
}

#recentImagesLabel.section-minimized {
  position: relative !important;
  display: inline-block !important;
  margin-left: 0 !important;
  margin-top: 5px !important;
}

#recentImagesMinBtn.section-minimized {
  position: relative !important;
  display: inline-block !important;
  margin-top: 5px !important;
  margin-left: 8px;
}

/* ========================================
   Premium Upgrade Modal (pum-)
   ======================================== */

.pum-modal {
  background: linear-gradient(145deg, #1e1e22, #2a2a30) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  max-width: 660px;
  width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,215,0,0.15);
  position: relative;
}

.pum-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 4px 8px;
}
.pum-close:hover { color: #fff; }

.pum-header {
  text-align: center;
  padding: 28px 24px 12px;
}

.pum-crown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffbf4a, #f59e0b);
  margin-bottom: 12px;
}
.pum-crown-icon i {
  font-size: 22px;
  color: #1e1e22;
}

.pum-title {
  color: #ffbf4a;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.pum-subtitle {
  color: #999;
  font-size: 13px;
  margin: 0;
}

.pum-welcome {
  background: rgba(249, 104, 84, 0.12);
  border: 1px solid rgba(249, 104, 84, 0.25);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 0 20px 12px;
  color: #f0b0a0;
  font-size: 12.5px;
  line-height: 1.5;
}
.pum-welcome i { margin-right: 6px; color: #F96854; }

.pum-mission {
  padding: 0 24px 16px;
  color: #b0b0b0;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: center;
}

/* Comparison table */
.pum-comparison {
  padding: 0 16px;
  margin-bottom: 16px;
}

.pum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pum-table thead th {
  padding: 8px 6px;
  text-align: center;
  color: #ccc;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #444;
  vertical-align: bottom;
}
.pum-table thead th:first-child {
  text-align: left;
  color: #999;
  font-size: 11px;
  font-weight: 500;
}

.pum-col-free { color: #888 !important; }

.pum-col-tier { color: #ddd; }

.pum-popular {
  position: relative;
  background: rgba(255,191,74,0.06);
}

.pum-popular-badge {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffbf4a;
  margin-top: 3px;
}

.pum-price {
  font-size: 11px;
  font-weight: 700;
  color: #ffbf4a;
}

.pum-table tbody td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #ccc;
  font-size: 11.5px;
}
.pum-table tbody td:first-child {
  text-align: left;
  color: #aaa;
  font-size: 11.5px;
}

.pum-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.pum-highlight {
  color: #6ee7b7;
  font-weight: 600;
}

.pum-yes { color: #6ee7b7; font-size: 13px; }
.pum-no { color: #555; font-size: 12px; }

.pum-small { font-size: 10px; color: #777; }

.pum-all-tiers-toggle {
  text-align: center;
  padding: 10px 0;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
}
.pum-all-tiers-toggle:hover { color: #ffbf4a; }
.pum-all-tiers-toggle i { margin-right: 4px; font-size: 10px; }

.pum-all-tiers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 8px 0 4px;
}

.pum-tier-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.pum-tier-card-name {
  font-size: 11px;
  color: #ccc;
  margin-bottom: 2px;
}
.pum-tier-card-price {
  font-size: 16px;
  font-weight: 700;
  color: #ffbf4a;
}
.pum-tier-card-steps {
  font-size: 10px;
  color: #888;
  margin-top: 3px;
}

/* Video queue explainer */
.pum-explainer {
  margin: 0 20px 16px;
  padding: 12px 14px;
  background: rgba(110, 231, 183, 0.06);
  border: 1px solid rgba(110, 231, 183, 0.12);
  border-radius: 8px;
}
.pum-explainer-title {
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
  margin-bottom: 6px;
}
.pum-explainer-title i { margin-right: 5px; }
.pum-explainer p {
  font-size: 11.5px;
  line-height: 1.6;
  color: #aaa;
  margin: 0;
}
.pum-explainer strong { color: #ccc; }

/* CTA buttons */
.pum-ctas {
  padding: 0 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pum-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  box-sizing: border-box;
}

.pum-btn-primary {
  background: linear-gradient(135deg, #F96854, #e05540);
  color: #fff;
}
.pum-btn-primary:hover {
  background: linear-gradient(135deg, #ff7a68, #F96854);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 104, 84, 0.3);
}

.pum-btn-secondary {
  background: rgba(249, 104, 84, 0.12);
  color: #f0a090;
  border: 1px solid rgba(249, 104, 84, 0.25);
}
.pum-btn-secondary:hover {
  background: rgba(249, 104, 84, 0.2);
}

.pum-btn-crypto {
  background: rgba(255, 191, 74, 0.12);
  color: #ffbf4a;
  border: 1px solid rgba(255, 191, 74, 0.25);
}
.pum-btn-crypto:hover {
  background: rgba(255, 191, 74, 0.2);
}

/* Footer */
.pum-footer {
  padding: 12px 20px 20px;
  text-align: center;
}
.pum-footer-note {
  font-size: 11px;
  color: #666;
  margin: 0 0 10px;
  line-height: 1.5;
}
.pum-btn-skip {
  background: none;
  border: none;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
}
.pum-btn-skip:hover { color: #888; }

/* Crown button redesign */
#crownButton {
  color: #d4a843 !important;
  position: relative;
  cursor: pointer;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 14px;
  min-width: 36px;
  min-height: 36px;
  justify-content: center;
  transition: color 0.2s;
}
#crownButton:hover {
  color: #ffbf4a !important;
}
#crownButton .crown-label {
  font-size: 11px;
  font-weight: 600;
  color: inherit;
}

/* Premium homepage banner */
.premium-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  margin: -2px 0 6px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  font-size: 11px;
  color: #999;
  line-height: 1.5;
}
.premium-banner i.fa-crown { color: #c9a24a; font-size: 13px; flex-shrink: 0; }
.premium-banner-text { flex: 1; }
.premium-banner-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #bbb;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.premium-banner-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #ddd;
}
.premium-banner-close {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.premium-banner-close:hover { color: #888; }

/* Supporter Extras lock overlay upgrade CTA */
.pum-lock-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.pum-lock-btn {
  padding: 5px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: #ccc;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.pum-lock-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.pum-lock-price {
  font-size: 10px;
  color: #777;
}

/* Contextual upgrade links */
.pum-upgrade-link {
  color: #c9a24a;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}
.pum-upgrade-link:hover { color: #e0b85a; }

/* Mobile responsive */
@media (max-width: 600px) {
  .pum-modal {
    max-width: 100vw;
    width: 100vw;
    border-radius: 0 !important;
    max-height: 100vh;
  }
  .pum-table { font-size: 10.5px; }
  .pum-table thead th { font-size: 10.5px; padding: 6px 3px; }
  .pum-table tbody td { padding: 6px 3px; font-size: 10.5px; }
  .pum-header { padding: 20px 16px 8px; }
  .pum-title { font-size: 18px; }
  .pum-mission { font-size: 11.5px; padding: 0 16px 12px; }
  .pum-ctas { padding: 0 16px 8px; }
  .pum-btn { font-size: 13px; padding: 11px 14px; }
  .pum-all-tiers-list { grid-template-columns: repeat(2, 1fr); }

  #crownButton .crown-label { display: none; }

  .premium-banner {
    flex-wrap: wrap;
    padding: 8px 12px;
    font-size: 11px;
    position: relative;
    padding-right: 28px;
  }
  .premium-banner-btn {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }
  .premium-banner-close {
    position: absolute;
    top: 4px;
    right: 4px;
  }
}
