:root {
    --bg-main: #07090e;
    --bg-panel: rgba(15, 23, 42, 0.75);
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(51, 65, 85, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.35);
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-purple: #a855f7;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --transition-fast: 0.18s ease;
    --transition-normal: 0.28s ease;
    --glow-cyan: 0 0 24px rgba(0, 242, 254, 0.35);
    --glow-blue: 0 0 24px rgba(79, 172, 254, 0.35);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background Atmosphere */
.background-glow {
    position: fixed;
    top: -20%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.background-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
}

.logo-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    box-shadow: var(--glow-cyan);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-cyan);
}

/* LAN Host Badge */
.lan-host-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: #6ee7b7;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lan-host-badge:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.6);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.8;
}

/* Account Card in Header */
.account-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.account-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
}

.account-card img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.account-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.trust-badge {
    font-size: 10px;
    color: var(--accent-cyan);
}

.chevron-down {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Container Layout */
.main-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    padding: 24px 28px;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Panel Styles */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #07090e;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 242, 254, 0.3);
}

/* Left Panel: Avatar Selector */
.avatar-select-container {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    overflow: hidden;
}

.search-bar {
    display: flex;
    gap: 8px;
}

.search-bar input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.avatars-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 600px;
    padding-right: 4px;
}

/* Avatar Card */
.avatar-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.avatar-card-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
}

.avatar-card-item.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
    box-shadow: 0 0 16px rgba(0, 242, 254, 0.15);
}

.avatar-card-thumb,
.avatar-item-img {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #0f172a;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.avatar-card-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-card-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.platform-tags {
    display: flex;
    gap: 6px;
}

.p-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.p-tag.pc { background: rgba(79, 172, 254, 0.2); color: #7dd3fc; }
.p-tag.quest { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.p-tag.public {
    background: rgba(34, 197, 94, 0.16);
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.35);
    font-weight: 700;
}
.p-tag.private {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-weight: 700;
}

.avatar-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 6px;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.card-action-btn:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-cyan);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.25);
}

.card-action-btn.pc:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
}

.card-action-btn.quest:hover {
    border-color: #c084fc;
    background: rgba(192, 132, 252, 0.2);
}

.card-action-btn.delete {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.card-action-btn.delete:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.header-right-tools {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.download-vrca-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-vrca-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 242, 254, 0.12);
    border: 1px solid rgba(0, 242, 254, 0.35);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.download-vrca-btn:hover {
    background: rgba(0, 242, 254, 0.25);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);
    transform: translateY(-1px);
}

.download-vrca-btn.quest {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.35);
}

.download-vrca-btn.quest:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: var(--accent-purple);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

/* New Avatar Section */
.new-avatar-info {
    padding: 24px;
}

.info-card {
    background: rgba(0, 242, 254, 0.05);
    border: 1px dashed rgba(0, 242, 254, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent-cyan);
}

.info-list {
    margin-top: 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

/* Right Panel: Upload Studio */
.target-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.target-indicator .tag {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.target-indicator .target-name {
    font-weight: 600;
    color: #fff;
}

.upload-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Dropzones Grid */
.dropzones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 180px;
    gap: 18px;
}

@media (max-width: 800px) {
    .dropzones-grid {
        grid-template-columns: 1fr;
    }
}

.dropzone-card {
    background: var(--bg-card);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.dropzone-card:hover, .dropzone-card.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.05);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.dropzone-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dropzone-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.dropzone-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.file-badge {
    position: absolute;
    inset: 10px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--accent-cyan);
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
}

.remove-file-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
}

/* Thumbnail Preview */
.thumbnail-dropzone img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* Form Fields */
.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group textarea, .form-group select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

/* Submit Action Footer */
.action-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.submit-btn {
    position: relative;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    border: none;
    color: #07090e;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 14px 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.4);
    transition: var(--transition-normal);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: modalPop 0.22s ease-out;
}

.modal-card.mini-modal { max-width: 380px; }
.modal-card.progress-card { max-width: 680px; }

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.close-modal-btn:hover { color: #fff; }

.modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Saved Accounts in Modal */
.saved-accounts-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.accounts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.account-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.account-modal-item.current {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
}

.account-modal-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-modal-left img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.account-modal-name {
    font-size: 13px;
    font-weight: 600;
}

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

.switch-acc-btn {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.del-acc-btn {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #f87171;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 4px 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.divider span { padding: 0 10px; }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-submit-btn {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    color: #07090e;
    font-family: inherit;
    font-weight: 700;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 6px;
}

.twofa-input {
    font-family: var(--font-mono);
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
}

/* Progress / Uploading Modal Steps */
.steps-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted);
}

.step-item.active .step-circle {
    background: var(--accent-cyan);
    color: #07090e;
    box-shadow: 0 0 16px var(--accent-cyan);
}

.step-item.completed .step-circle {
    background: var(--accent-emerald);
    color: #fff;
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 8px 16px;
}

.progress-bar-container {
    position: relative;
    height: 22px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #00f2fe, #4facfe, #10b981);
    box-shadow: 0 0 16px rgba(0, 242, 254, 0.6);
    transition: width 0.3s ease;
}

.progress-percentage {
    position: relative;
    z-index: 2;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.progress-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 2px;
    font-size: 12px;
}

.progress-elapsed {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.current-status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    text-align: center;
    margin: 6px 0;
}

/* Terminal Logs */
.terminal-logs {
    background: #060911;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-line {
    color: #cbd5e1;
    line-height: 1.4;
}

.log-line .log-time {
    color: var(--text-muted);
    margin-right: 6px;
}

.log-line.system { color: #7dd3fc; }
.log-line.error { color: #f87171; }
.log-line.success { color: #4ade80; }

/* Success Box */
.success-result {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-emerald);
    padding: 14px;
    border-radius: var(--radius-md);
    color: #6ee7b7;
}

.success-check { font-size: 28px; }

.success-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.success-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.success-info .code-font {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.copy-small-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.success-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.vrc-link-btn {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.primary-btn {
    background: var(--accent-cyan);
    border: none;
    color: #07090e;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #0f172a;
    border: 1px solid var(--accent-cyan);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastSlide 0.25s ease;
}

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.hidden { display: none !important; }

/* ========================================================
   Header Enhancements (Worker Pool, Task Tray, Discord, Debug)
   ======================================================== */
.debug-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.worker-pool-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    color: var(--text-secondary);
}

.pool-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: poolPulse 2s infinite ease-in-out;
}

@keyframes poolPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

.pool-label {
    font-weight: 500;
    color: var(--text-muted);
}

.pool-stat {
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.task-tray-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(168, 85, 247, 0.12));
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.task-tray-toggle:hover {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(168, 85, 247, 0.25));
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.tray-badge {
    background: var(--accent-cyan);
    color: #07090e;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.discord-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.35);
    padding: 4px 10px 4px 6px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    color: #e0e7ff;
}

.discord-mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-username {
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.logout-btn:hover {
    color: #f43f5e;
}

/* Upload Account Banner inside Form */
.upload-account-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 13px;
    margin-bottom: 8px;
}

.banner-icon {
    font-size: 16px;
}

.banner-text {
    color: var(--text-secondary);
}

.banner-acc-name {
    color: var(--accent-cyan);
    font-weight: 700;
}

.banner-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* ========================================================
   Top-Right Floating Notifications Deck (Background Uploads)
   ======================================================== */
.upload-notifications-container {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 990;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding-bottom: 20px;
    pointer-events: none;
}

/* Custom Scrollbar for Notifications Deck */
.upload-notifications-container::-webkit-scrollbar {
    width: 5px;
}
.upload-notifications-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.upload-task-card {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--transition-fast);
    animation: taskCardSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes taskCardSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.upload-task-card:hover {
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 242, 254, 0.12);
}

/* Task Status Variants */
.upload-task-card.status-processing {
    border-left: 4px solid var(--accent-cyan);
}

.upload-task-card.status-queued {
    border-left: 4px solid #f59e0b;
}

.upload-task-card.status-success {
    border-left: 4px solid var(--accent-emerald);
}

.upload-task-card.status-error {
    border-left: 4px solid var(--accent-rose);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-account-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.card-acc-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.card-acc-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-status-pill.processing {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
}

.card-status-pill.queued {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.card-status-pill.success {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.card-status-pill.error {
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
}

.card-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Card Body */
.card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-avatar-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.card-tags {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-slot-tag {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.card-time-tag {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Card Progress Bar */
.card-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-progress-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.card-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2fe, #4facfe, #a855f7);
    border-radius: 4px;
    transition: width 0.35s ease;
    position: relative;
}

.card-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progressStripe 1.5s linear infinite;
}

@keyframes progressStripe {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.card-progress-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    min-width: 36px;
    text-align: right;
}

/* Current Step Status Text */
.card-status-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Card Live Log Drawer */
.card-log-drawer {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
    max-height: 72px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-log-line {
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.35;
}

/* Card Success Banner */
.card-result-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: 2px;
}

.card-result-id-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
}

.card-id-text {
    font-family: var(--font-mono);
    color: #34d399;
    font-weight: 600;
}

.card-copy-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.card-result-actions {
    display: flex;
    gap: 6px;
}

.card-vrc-link {
    font-size: 11px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
}

/* Card Error Banner */
.card-error-box {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #fb7185;
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-inspect-btn {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fca5a5;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-start;
}

/* Minimized Card State */
.upload-task-card.minimized .card-body {
    display: none;
}

/* Log Inspector Modal Styling */
.log-inspector-card {
    max-width: 800px;
    width: 90vw;
}

.log-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.terminal-logs.large {
    max-height: 480px;
    height: 420px;
}

