:root {
    /* Color Palette — Vintage Old Beige / Warm Parchment */
    --bg-main: #f5efe6;                    /* Warm antique beige */
    --bg-panel: rgba(255, 252, 247, 0.88); /* Warm ivory cream parchment */
    --border-color: #dfd3c3;                /* Aged sepia-sand border */
    
    --text-primary: #2d241e;                /* Rich dark espresso charcoal - clear & crisp */
    --text-secondary: #6e6053;              /* Warm vintage taupe */
    --text-muted: #9b8a7c;                  /* Soft aged sepia */

    --accent-primary: #9e552f;              /* Burnt terracotta / saddle leather */
    --accent-secondary: #4a6b5d;            /* Antique botanical sage / forest moss */
    
    --success: #28734c;                     /* Deep vintage pine green */
    --warning: #b36e14;                     /* Antique amber / warm ochre */
    --danger: #b83a3a;                      /* Vintage rust / crimson */

    /* Effects */
    --glass-blur: 14px;
    --shadow-sm: 0 2px 5px rgba(90, 70, 50, 0.04);
    --shadow-md: 0 10px 25px -4px rgba(90, 70, 50, 0.08), 0 4px 6px -2px rgba(90, 70, 50, 0.03);
    --shadow-glow: 0 0 24px rgba(158, 85, 47, 0.16);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
}

/* Background Shapes — Warm Vintage Ambient Glow */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.55;
    animation: float 22s infinite ease-in-out alternate;
}

.shape-1 {
    width: 650px;
    height: 650px;
    background: #ebdcc9;
    top: -200px;
    left: -200px;
}

.shape-2 {
    width: 550px;
    height: 550px;
    background: #ded0bc;
    bottom: -150px;
    right: -100px;
    animation-delay: -6s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.05); }
    100% { transform: translate(-20px, 60px) scale(0.95); }
}

/* Typography & Layout */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-primary), #c27d48);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-weight: 400;
    color: var(--text-secondary);
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(40, 115, 76, 0.08);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(40, 115, 76, 0.22);
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* Upload Section */
.upload-section {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(255, 252, 247, 0.65);
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.upload-section.drag-active {
    border-color: var(--accent-primary);
    background: rgba(158, 85, 47, 0.06);
    box-shadow: var(--shadow-glow);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    gap: 1rem;
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(158, 85, 47, 0.12), rgba(74, 107, 93, 0.14));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    transition: var(--transition-smooth);
}

.upload-section.drag-active .upload-icon-wrapper {
    transform: scale(1.1) translateY(-10px);
}

.browse-link {
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: var(--transition-fast);
}

.browse-link:hover {
    color: #7a3d1c;
}

.supported-formats {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #a35833, #8c4524);
    color: #fffdf9;
    box-shadow: 0 3px 10px rgba(140, 69, 36, 0.2);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(140, 69, 36, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(184, 58, 58, 0.08);
    color: var(--danger);
    border: 1px solid rgba(184, 58, 58, 0.28);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: #fffdf9;
}

.btn-warning {
    background: rgba(179, 110, 20, 0.08);
    color: var(--warning);
    border: 1px solid rgba(179, 110, 20, 0.28);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning);
    color: #fffdf9;
}

.btn-success {
    background: rgba(40, 115, 76, 0.08);
    color: var(--success);
    border: 1px solid rgba(40, 115, 76, 0.28);
}

.btn-success:hover:not(:disabled) {
    background: var(--success);
    color: #fffdf9;
}

.btn-preset {
    background: rgba(158, 85, 47, 0.08);
    border: 1px solid rgba(158, 85, 47, 0.24);
    color: #8c4524;
}

.btn-preset:hover:not(:disabled) {
    background: rgba(158, 85, 47, 0.16);
    border-color: var(--accent-primary);
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 2rem;
    align-items: start;
}

.file-queue,
.metadata-inspector {
    min-width: 0;
    max-width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    min-width: 0;
    gap: 0.75rem;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
}

/* File Queue */
.file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(140, 115, 90, 0.08);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #ccbcab;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b5a491;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.file-item:hover {
    background: #ffffff;
    border-color: #cbbeae;
    box-shadow: 0 2px 8px rgba(90, 70, 50, 0.04);
}

.file-item.active {
    background: rgba(158, 85, 47, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 10px rgba(158, 85, 47, 0.1);
}

.file-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 0.75rem;
    background: #eadecf;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    display: block;
    width: 100%;
    min-width: 0;
    color: var(--text-primary);
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.file-meta > span:first-child {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.status-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pending { 
    background: rgba(140, 115, 90, 0.12); 
    color: var(--text-secondary); 
}
.status-cleaned { 
    background: rgba(40, 115, 76, 0.12); 
    color: var(--success); 
    border: 1px solid rgba(40, 115, 76, 0.22);
}
.status-processing {
    background: rgba(179, 110, 20, 0.12);
    color: var(--warning);
}

/* Metadata Inspector */
.selected-file {
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-weight: 600;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    min-width: 0;
}

.inspector-content {
    min-height: 300px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Metadata Categories */
.meta-category {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.meta-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(140, 115, 90, 0.05);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.meta-category-header i {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.meta-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.meta-table th, .meta-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(140, 115, 90, 0.1);
    vertical-align: top;
}

.meta-table th {
    width: 32%;
    color: var(--text-secondary);
    font-weight: 500;
    word-break: break-word;
}

.meta-table td {
    width: 68%;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.meta-table tr:last-child td, .meta-table tr:last-child th {
    border-bottom: none;
}

/* Code block inside meta-table */
.meta-table td div[style*="overflow-y"] {
    background: #ede3d5 !important;
    border: 1px solid #dcd0be !important;
    color: #352a22 !important;
}

.val-highlight {
    color: var(--accent-secondary);
    font-weight: 600;
}

.val-warning {
    color: var(--warning);
    font-weight: 600;
}

/* File Type Icons (for non-image previews) */
.file-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-type-icon.video-icon {
    background: linear-gradient(135deg, rgba(184, 58, 58, 0.12), rgba(179, 110, 20, 0.12));
    color: var(--danger);
    border: 1px solid rgba(184, 58, 58, 0.25);
}

.file-type-icon.vector-icon {
    background: linear-gradient(135deg, rgba(40, 115, 76, 0.12), rgba(74, 107, 93, 0.12));
    color: var(--success);
    border: 1px solid rgba(40, 115, 76, 0.25);
}

/* File Category Badge */
.file-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.35rem;
}

.badge-image {
    background: rgba(158, 85, 47, 0.1);
    color: var(--accent-primary);
}

.badge-video {
    background: rgba(184, 58, 58, 0.1);
    color: var(--danger);
}

.badge-vector {
    background: rgba(40, 115, 76, 0.1);
    color: var(--success);
}

/* Video thumbnail preview */
.file-preview-video {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 1rem;
    background: #eadecf;
    border: 1px solid var(--border-color);
    position: relative;
}

.action-download-single {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-item-download {
    background: rgba(40, 115, 76, 0.12);
    color: var(--success);
    border: 1px solid rgba(40, 115, 76, 0.3);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.btn-item-download:hover {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 115, 76, 0.25);
    transform: translateY(-1px);
}

/* ============================================================
   C2PA / CONTENT CREDENTIALS STYLES
   ============================================================ */

.status-badge.c2pa-badge {
    background: rgba(184, 58, 58, 0.1);
    color: var(--danger);
    border: 1px solid rgba(184, 58, 58, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
}

.meta-category.c2pa-category {
    border: 1px solid rgba(184, 58, 58, 0.3);
    background: linear-gradient(180deg, rgba(184, 58, 58, 0.05) 0%, rgba(255, 252, 247, 0.85) 100%);
    box-shadow: 0 4px 15px rgba(184, 58, 58, 0.04);
}

.c2pa-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--danger);
}

.c2pa-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(184, 58, 58, 0.1);
    color: var(--danger);
    border: 1px solid rgba(184, 58, 58, 0.25);
}

.c2pa-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(158, 85, 47, 0.09);
    color: #8c4524;
    border: 1px solid rgba(158, 85, 47, 0.22);
    margin: 2px 4px 2px 0;
}

.c2pa-pill.pill-danger {
    background: rgba(184, 58, 58, 0.1);
    color: var(--danger);
    border-color: rgba(184, 58, 58, 0.25);
}

.c2pa-pill.pill-warning {
    background: rgba(179, 110, 20, 0.1);
    color: var(--warning);
    border-color: rgba(179, 110, 20, 0.25);
}

.c2pa-pill.pill-success {
    background: rgba(40, 115, 76, 0.1);
    color: var(--success);
    border-color: rgba(40, 115, 76, 0.25);
}

.c2pa-tree-box {
    background: #ede3d5;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #352a22;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dcd0be;
}

.c2pa-quick-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(184, 58, 58, 0.06);
    border-top: 1px solid rgba(184, 58, 58, 0.18);
}

.c2pa-quick-strip span {
    font-size: 0.8rem;
    color: #a83838;
}

/* ============================================================
   FOOTER & FV LABS BRANDING
   ============================================================ */

.app-footer {
    margin-top: auto;
    padding: 2rem 0 1rem 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.fv-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.fv-brand-link:hover {
    background: rgba(158, 85, 47, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(158, 85, 47, 0.16);
    color: #7a3d1c;
}

.fv-brand-name {
    background: linear-gradient(135deg, #a35833, #4a6b5d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.footer-dot {
    color: var(--border-color);
    font-size: 0.75rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================================
   GOOGLE AUTH & USER PROFILE BAR
   ============================================================ */

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.btn-auth {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
    border-radius: 100px;
}

.btn-auth:hover {
    background: #fffdf9;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 2px 10px rgba(158, 85, 47, 0.15);
}

.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-profile-manage {
    background: rgba(158, 85, 47, 0.08);
    border: 1px solid rgba(158, 85, 47, 0.25);
    color: var(--accent-primary);
    border-radius: 100px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.btn-profile-manage:hover {
    background: rgba(158, 85, 47, 0.15);
    border-color: var(--accent-primary);
}

.user-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 0.25rem 0.65rem 0.25rem 0.35rem;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.btn-logout-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
    padding: 0;
}

.btn-logout-icon:hover {
    color: var(--danger);
}

/* ============================================================
   MULTI-PC PROFILES IN QUICK ACTIONS
   ============================================================ */

.quick-actions-row {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.action-group-profiles {
    flex: 1;
    min-width: 320px;
}

.group-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-text-action {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-text-action:hover {
    background: rgba(158, 85, 47, 0.08);
    text-decoration: underline;
}

.btn-profile-apply {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.55rem 0.95rem;
    text-align: left;
    line-height: 1.25;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
}

.btn-profile-apply:hover {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 3px 12px rgba(158, 85, 47, 0.14);
}

.btn-profile-empty {
    border-style: dashed !important;
    background: rgba(158, 85, 47, 0.04) !important;
    opacity: 0.88;
    transition: all var(--transition-fast);
}

.btn-profile-empty:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(158, 85, 47, 0.09) !important;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(158, 85, 47, 0.14);
}

.btn-prof-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-prof-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 3px;
    font-weight: 500;
}

/* ============================================================
   MODAL DIALOG (MULTI-PC PROFILES)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(35, 27, 21, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-card {
    width: 100%;
    max-width: 640px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(70, 50, 30, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.4);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(158, 85, 47, 0.12);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(140, 115, 90, 0.05);
}

.profile-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
}

.profile-tab-btn.active {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: var(--accent-primary);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

.form-input,
.form-select {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(158, 85, 47, 0.12);
    background: #ffffff;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-preview-box {
    background: #ede4d7;
    border: 1px solid #dcd0bf;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #352a22;
    line-height: 1.5;
}

.profile-preview-box code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 600;
    color: var(--accent-primary);
}

.modal-sync-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(140, 115, 90, 0.03);
}

.btn-secondary {
    background: rgba(140, 115, 90, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(140, 115, 90, 0.18);
    color: var(--text-primary);
}

/* Admin Button in Header */
.btn-admin {
    background: rgba(184, 58, 58, 0.1);
    border: 1px solid rgba(184, 58, 58, 0.3);
    color: var(--danger);
    font-weight: 700;
    border-radius: 100px;
    padding: 0.4rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-admin:hover {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(184, 58, 58, 0.25);
}

/* ============================================================
   MANDATORY LOGIN WALL (NO OFFLINE ACCESS)
   ============================================================ */

.login-wall-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(30, 24, 19, 0.8);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease-out;
}

.login-wall-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(50, 35, 20, 0.3);
    padding: 2.25rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.login-wall-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(158, 85, 47, 0.15), rgba(74, 107, 93, 0.15));
    border: 1px solid rgba(158, 85, 47, 0.25);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.login-wall-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-wall-desc {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.login-wall-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
}

.wall-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.wall-feature-item i {
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

.btn-google-wall {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(158, 85, 47, 0.25);
}

.login-wall-note {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================================
   ADMIN CONSOLE MODAL
   ============================================================ */

.modal-card-lg {
    max-width: 820px;
}

.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(140, 115, 90, 0.03);
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
}

.admin-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.admin-search-wrap i {
    position: absolute;
    left: 10px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.admin-search-wrap input {
    width: 100%;
    padding-left: 2.2rem;
}

.admin-table-container {
    max-height: 380px;
    overflow-y: auto;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.admin-table th {
    position: sticky;
    top: 0;
    background: #f7f1e9;
    z-index: 2;
    padding: 0.75rem 1rem;
}

.admin-table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.admin-table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.role-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
}

.badge-admin {
    background: rgba(184, 58, 58, 0.12);
    color: var(--danger);
    border: 1px solid rgba(184, 58, 58, 0.3);
}

.badge-user {
    background: rgba(40, 115, 76, 0.1);
    color: var(--success);
    border: 1px solid rgba(40, 115, 76, 0.25);
}

/* ============================================================
   RESPONSIVE DESIGN & SMARTPHONE OPTIMIZATIONS
   ============================================================ */

/* Tablet & Intermediate Screens (<= 900px) */
@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Smartphone Screens (<= 600px) */
@media (max-width: 600px) {
    /* Layout & Container */
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0.85rem 0.65rem;
        gap: 1rem;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .bg-shape {
        filter: blur(70px);
        opacity: 0.35;
    }

    /* Header & Branding */
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .logo {
        justify-content: center;
        font-size: 1.35rem;
        user-select: none;
    }

    .header-right {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.45rem;
        width: 100%;
    }

    .privacy-badge {
        font-size: 0.76rem;
        padding: 0.35rem 0.65rem;
        gap: 0.35rem;
    }

    .privacy-badge input {
        width: 48px !important;
        font-size: 11px !important;
        padding: 2px 4px !important;
    }

    .auth-container {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .user-profile-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
    }

    .user-avatar-wrap {
        padding: 0.2rem 0.5rem 0.2rem 0.25rem;
    }

    .user-name {
        max-width: 80px;
        font-size: 0.75rem;
    }

    .btn-profile-manage {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .btn-auth {
        padding: 0.4rem 0.8rem;
        font-size: 0.82rem;
    }

    /* Upload Drop Zone */
    .upload-section {
        cursor: pointer;
        border-width: 2px;
        border-radius: var(--radius-md);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .upload-section:active {
        background: rgba(158, 85, 47, 0.08);
        transform: scale(0.99);
    }

    .upload-content {
        padding: 2.25rem 1rem;
        gap: 0.75rem;
    }

    .upload-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 2.2rem;
        margin-bottom: 0.25rem;
    }

    .upload-content h2 {
        font-size: 1.25rem;
    }

    .upload-content p {
        font-size: 0.9rem;
    }

    .supported-formats {
        font-size: 0.74rem;
        line-height: 1.4;
        padding: 0 0.5rem;
    }

    /* Glass Panels */
    .glass-panel {
        padding: 1rem 0.85rem;
        border-radius: var(--radius-md);
    }

    /* Quick Actions */
    .quick-actions-row {
        flex-direction: column;
        gap: 1.15rem;
        width: 100%;
    }

    .action-group {
        width: 100%;
        min-width: 0;
    }

    /* Clean Modes (Clear All & Stock Safe side-by-side) */
    .action-group:first-child .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .action-group:first-child .action-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 0.5rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    /* Multi-PC Profiles */
    .action-group-profiles {
        min-width: 0 !important;
        width: 100%;
    }

    #customProfilesButtons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .btn-profile-apply,
    .btn-profile-empty {
        width: 100% !important;
        box-sizing: border-box;
        min-height: 48px;
        padding: 0.65rem 0.85rem;
    }

    .btn-prof-title {
        max-width: 100% !important;
    }

    /* File Queue Header & Action */
    .panel-header {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.65rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .panel-header h3 {
        order: 1;
        font-size: 1.05rem;
    }

    .panel-header-actions {
        display: contents;
    }

    #btn-add-more {
        order: 2;
        font-size: 0.8rem;
        padding: 0.45rem 0.8rem;
        min-height: 36px;
    }

    #btn-download-all {
        order: 3;
        width: 100% !important;
        min-height: 46px;
        font-size: 0.95rem;
        font-weight: 700;
        justify-content: center;
    }

    /* File List & Items */
    .file-list {
        max-height: 280px;
        -webkit-overflow-scrolling: touch;
        padding-right: 0.25rem;
    }

    .file-item {
        min-height: 52px;
        padding: 0.65rem;
        width: 100%;
        box-sizing: border-box;
    }

    .file-preview {
        width: 44px;
        height: 44px;
    }

    .file-name {
        font-size: 0.88rem;
    }

    /* Metadata Inspector */
    .metadata-inspector {
        width: 100%;
        min-width: 0;
    }

    .selected-file {
        max-width: 150px;
        font-size: 0.8rem;
    }

    .meta-table {
        table-layout: fixed;
        width: 100%;
    }

    .meta-table th {
        width: 36%;
        padding: 0.5rem 0.4rem;
        font-size: 0.78rem;
        word-break: break-word;
    }

    .meta-table td {
        width: 64%;
        padding: 0.5rem 0.4rem;
        font-size: 0.78rem;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .meta-category-header {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .c2pa-category-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .c2pa-status-pill {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .c2pa-tree-box {
        font-size: 0.7rem;
        padding: 8px;
        max-height: 160px;
    }

    .action-download-single {
        margin-top: 1rem;
        width: 100%;
    }

    .action-download-single .btn {
        width: 100% !important;
        min-height: 46px;
        justify-content: center;
        font-size: 0.95rem;
    }

    /* Modals (Profiles Modal, Login Wall, Admin Modal) */
    .modal-overlay {
        padding: 0.5rem;
        align-items: center;
    }

    .modal-card {
        max-height: 92vh;
        width: 100%;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 0.85rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.05rem;
    }

    .modal-subtext {
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .modal-profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .profile-tab-btn {
        padding: 0.65rem 0.5rem;
        font-size: 0.78rem;
        white-space: nowrap;
        flex: 1;
        min-width: 85px;
    }

    .modal-body {
        padding: 1rem 0.85rem;
        gap: 0.75rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-group {
        min-width: 100% !important;
        flex: none !important;
    }

    .form-input, .form-select {
        font-size: 16px !important; /* Prevents auto-zoom on mobile iOS Safari */
        padding: 0.6rem 0.75rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }

    .modal-footer > div {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1;
        justify-content: center;
        font-size: 0.85rem;
        min-height: 42px;
    }

    #resetCurrentProfileBtn {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    /* Login Wall Modal */
    .login-wall-overlay {
        padding: 0.75rem;
    }

    .login-wall-card {
        padding: 1.5rem 1rem;
        max-height: 92vh;
        overflow-y: auto;
        gap: 0.85rem;
    }

    .login-wall-icon {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }

    .login-wall-card h2 {
        font-size: 1.2rem;
    }

    .login-wall-desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .login-wall-features {
        padding: 0.75rem 0.85rem;
        gap: 0.5rem;
    }

    .wall-feature-item {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .btn-google-wall {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        min-height: 46px;
    }

    /* Admin Console */
    .admin-stats-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem 1rem 0.5rem 1rem;
    }

    .admin-table-container {
        padding: 0 1rem 1rem 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table th, .admin-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Footer */
    .app-footer {
        padding: 1.5rem 0 1rem 0;
    }

    .footer-content {
        font-size: 0.78rem;
        gap: 0.4rem;
        flex-direction: column;
    }

    .footer-dot {
        display: none;
    }
}

/* Super Small Smartphones (<= 380px) */
@media (max-width: 380px) {
    .container {
        padding: 0.75rem 0.45rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .privacy-badge span {
        display: none;
    }

    .action-group:first-child .action-buttons {
        grid-template-columns: 1fr;
    }
}
