:root {
    --theme-color: #1d3242;
    --theme-color-light: #2a4a5f;
    --theme-color-dark: #142430;
    --accent-color: #dc2015;
    --accent-hover: #b81a12;
    --success-color: #2e7d32;
    --success-bg: #e8f5e9;
    --warning-color: #ef6c00;
    --warning-bg: #fff3e0;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #888;
    --bg-primary: #f5f6f8;
    --bg-card: #ffffff;
    --border-color: #e0e4e8;
    --font-primary: "Open Sans", sans-serif;
    --font-heading: "Montserrat", sans-serif;
    --font-accent: "Noto Serif Display", serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

html {
    scroll-behavior: smooth;
    overscroll-behavior: none;
    overflow-x: hidden;
    height: 100%;
    position: static;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100%;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: static;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow-x: hidden;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    padding: 2rem;
    padding-top: 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Main Content */
.content {
    padding: 2rem;
}

/* Warning Banner for Invalid Codes */
.warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.warning-icon {
    width: 24px;
    height: 24px;
    color: var(--warning-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-icon svg {
    width: 24px;
    height: 24px;
}

.warning-content {
    flex: 1;
}

.warning-content strong {
    display: block;
    color: var(--warning-color);
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.warning-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Client-Specific Header */
.client-header {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
    border: 2px solid var(--theme-color);
    border-radius: var(--radius-md);
    animation: fadeIn 0.4s ease;
}

.client-icon {
    width: 48px;
    height: 48px;
    background: var(--theme-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.client-icon svg {
    width: 24px;
    height: 24px;
}

.case-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-color);
    margin-bottom: 0.5rem;
}

.custom-message {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

.intro-section {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-color);
    margin-bottom: 0.75rem;
}

.intro-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    max-width: 480px;
    margin: 0 auto;
}

/* Auth Section */
.auth-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.auth-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    border-color: var(--theme-color-light);
    box-shadow: var(--shadow-sm);
}

.lock-icon {
    width: 64px;
    height: 64px;
    background: var(--theme-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
}

.lock-icon svg {
    width: 28px;
    height: 28px;
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 0.5rem;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--theme-color);
    color: white;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.connect-btn:hover {
    background: var(--theme-color-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Upload Section */
.upload-section {
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none !important;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--success-bg);
    color: var(--success-color);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
}

.disconnect-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.disconnect-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--theme-color);
    background: rgba(29, 50, 66, 0.04);
    transform: scale(1.01);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-zone-content .file-select-btn {
    pointer-events: auto;
}

.drop-zone.drag-over .drop-zone-content {
    pointer-events: none;
}

.drop-zone.drag-over .drop-zone-content .file-select-btn {
    pointer-events: auto;
}

.upload-icon {
    width: 72px;
    height: 72px;
    background: var(--theme-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon,
.drop-zone.drag-over .upload-icon {
    transform: scale(1.05);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.drop-text {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 0.25rem;
}

.drop-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.file-select-btn {
    display: inline-block;
    background: var(--theme-color);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.file-select-btn:hover {
    background: var(--theme-color-light);
}

.file-select-btn input {
    display: none;
}

.file-info {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 1rem;
}

/* File Queue */
.file-queue {
    margin-top: 1.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.queue-title {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 0.75rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.file-icon {
    width: 36px;
    height: 36px;
    background: var(--theme-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.file-icon svg {
    width: 18px;
    height: 18px;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-remove {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: #fee2e2;
    color: var(--accent-color);
}

.file-remove svg {
    width: 16px;
    height: 16px;
}

.file-item.uploading {
    background: rgba(29, 50, 66, 0.04);
}

.file-item.uploaded {
    background: var(--success-bg);
    border-color: var(--success-color);
}

.file-item.uploaded .file-icon {
    background: var(--success-color);
}

.file-item.error {
    background: #fef2f2;
    border-color: var(--accent-color);
}

.file-item.error .file-icon {
    background: var(--accent-color);
}

.queue-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Upload Progress */
.upload-progress {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(29, 50, 66, 0.04);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-title {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--theme-color);
}

.progress-percent {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-color);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-color) 0%, var(--accent-color) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2rem;
    animation: scaleIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--success-color);
}

.success-icon svg {
    width: 36px;
    height: 36px;
}

.success-message h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    text-align: center;
}

.security-note svg {
    color: var(--success-color);
    flex-shrink: 0;
}

.contact {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.contact-item:hover {
    color: var(--accent-color);
}

.contact-item svg {
    width: 16px;
    height: 16px;
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ─── Mobile Portrait ─── */
@media (max-width: 499px) {
    body {
        padding: 0 !important;
        min-height: 100dvh;
        background: var(--theme-color);
        touch-action: auto;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: visible;
        background: #f8f9fa;
    }

    .header {
        padding: 1.25rem 1.5rem;
        padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
        flex-shrink: 0;
    }

    .logo {
        max-width: 200px;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .content {
        flex: 1;
        overflow-y: visible;
        padding: 1.25rem 1.5rem;
        background: var(--bg-card);
    }

    .footer {
        flex-shrink: 0;
        padding: 1rem 1.5rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .contact {
        flex-direction: row;
        justify-content: center;
        gap: 1.25rem;
    }

    .contact-item {
        font-size: 0.8125rem;
    }

    .security-note {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .copyright {
        font-size: 10px;
        white-space: nowrap;
    }

    .intro-section {
        margin-bottom: 1.25rem;
    }

    .page-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .intro-text {
        font-size: 0.875rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .drop-zone {
        padding: 1.5rem 1rem;
    }

    .upload-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 0.75rem;
    }

    .upload-icon svg {
        width: 26px;
        height: 26px;
    }

    .drop-text {
        font-size: 1rem;
    }

    .drop-subtext {
        margin-bottom: 0.75rem;
    }

    .file-info {
        margin-top: 0.75rem;
    }

    .queue-actions {
        flex-direction: column-reverse;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    .warning-banner {
        flex-direction: column;
        text-align: center;
    }

    .warning-icon {
        margin: 0 auto;
    }

    .client-header {
        padding: 1.25rem;
    }

    .case-name {
        font-size: 1.125rem;
    }
}

/* ─── Very Small Screens ─── */
@media (max-width: 359px) {
    .copyright {
        white-space: normal;
        line-height: 1.4;
    }

    .copyright .rights {
        display: block;
    }

    .header {
        padding: 1rem 1.25rem;
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    }

    .logo {
        max-width: 160px;
    }

    .content {
        padding: 1rem 1.25rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    .intro-text {
        font-size: 0.8125rem;
    }

    .drop-zone {
        padding: 1.25rem 0.75rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-icon svg {
        width: 22px;
        height: 22px;
    }

    .drop-text {
        font-size: 0.9375rem;
    }

    .file-select-btn {
        font-size: 0.8125rem;
        padding: 0.625rem 1.25rem;
    }

    .footer {
        padding: 0.75rem 1.25rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .contact {
        gap: 0.75rem;
    }

    .contact-item {
        font-size: 0.75rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
    }

    .client-header {
        padding: 1rem;
    }

    .case-name {
        font-size: 1rem;
    }

    .warning-banner {
        padding: 0.75rem;
    }
}

/* ─── Landscape (short viewport) ─── */
@media (max-height: 500px) and (orientation: landscape) {
    html {
        height: 100%;
    }

    body {
        padding: 0 !important;
        height: 100%;
        background: var(--bg-card);
        overflow: hidden;
        touch-action: auto;
    }

    /* Grid: header + footer stacked in col 1, content spans col 2 */
    .container {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        height: 100dvh;
        max-width: 100%;
        display: grid;
        grid-template-columns: 220px 1fr;
        grid-template-rows: 1fr auto;
        overflow: hidden;
    }

    .header {
        grid-column: 1;
        grid-row: 1 / -1;
        height: 100%;
        margin: 0;
        top: 0;
        left: 0;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        padding: 1rem;
        padding-left: calc(1rem + env(safe-area-inset-left, 0px));
        position: relative;
        background: linear-gradient(90deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    }

    /* Accent glow on sidebar edge */
    .header::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(180deg,
                transparent 10%,
                rgba(220, 32, 21, 0.25) 50%,
                transparent 90%);
        pointer-events: none;
    }

    .logo {
        max-width: 140px;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 0.625rem;
        letter-spacing: 1.5px;
    }

    /* Content: full-height scrollable right panel */
    .content {
        grid-column: 2;
        grid-row: 1 / -1;
        min-width: 0;
        height: 100%;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding: 1rem 1.25rem;
        padding-right: calc(1.25rem + env(safe-area-inset-right, 0px));
    }

    /* Footer: overlays bottom of sidebar */
    .footer {
        grid-column: 1;
        grid-row: 2;
        z-index: 1;
        background: linear-gradient(90deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding: 0.625rem 0.875rem;
        padding-left: calc(0.875rem + env(safe-area-inset-left, 0px));
    }

    .security-note {
        color: rgba(255, 255, 255, 0.4);
        font-size: 0.5625rem;
        margin-bottom: 0.375rem;
        justify-content: flex-start;
        gap: 0.25rem;
        line-height: 1.3;
        text-align: left;
    }

    .security-note svg {
        color: rgba(255, 255, 255, 0.3);
        width: 10px;
        height: 10px;
        min-width: 10px;
    }

    .contact {
        flex-direction: column;
        gap: 0.1875rem;
        margin-bottom: 0.375rem;
        justify-content: flex-start;
    }

    .contact-item {
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.6875rem;
        transition: color 0.2s ease;
    }

    .contact-item:hover {
        color: rgba(255, 255, 255, 0.95);
    }

    .contact-item svg {
        width: 11px;
        height: 11px;
        opacity: 0.5;
    }

    .copyright {
        color: rgba(255, 255, 255, 0.2);
        font-size: 0.5625rem;
        text-align: left;
        line-height: 1.4;
    }

    .copyright .rights {
        display: block;
    }

    /* Content area sizing */
    .intro-section {
        margin-bottom: 0.75rem;
    }

    .page-title {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .intro-text {
        font-size: 0.8125rem;
    }

    .drop-zone {
        padding: 1rem 0.75rem;
    }

    .upload-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0.5rem;
    }

    .upload-icon svg {
        width: 22px;
        height: 22px;
    }

    .drop-text {
        font-size: 0.9375rem;
    }

    .drop-subtext {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    .file-select-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1.25rem;
    }

    .file-info {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }

    .auth-card {
        padding: 1.25rem 1rem;
    }

    .lock-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .lock-icon svg {
        width: 22px;
        height: 22px;
    }

    .auth-card h2 {
        font-size: 1.0625rem;
    }

    .auth-card p {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
    }

    .connect-btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.5rem;
    }

    .client-header {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .client-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.5rem;
    }

    .case-name {
        font-size: 1rem;
    }

    .custom-message {
        font-size: 0.8125rem;
    }

    .warning-banner {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .file-list {
        max-height: 120px;
    }

    .queue-actions {
        gap: 0.5rem;
    }

    .primary-btn,
    .secondary-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
}

/* ─── Very Small Landscape (compact phones) ─── */
@media (max-height: 400px) and (orientation: landscape) {
    .container {
        grid-template-columns: 180px 1fr;
    }

    .logo {
        max-width: 110px;
    }

    .subtitle {
        font-size: 0.5625rem;
    }

    .footer {
        padding: 0.5rem 0.75rem;
        padding-left: calc(0.75rem + env(safe-area-inset-left, 0px));
    }

    .security-note {
        font-size: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .contact-item {
        font-size: 0.625rem;
    }

    .copyright {
        font-size: 0.5rem;
    }

    .content {
        padding: 0.75rem 1rem;
        padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    }

    .page-title {
        font-size: 1rem;
    }

    .drop-zone {
        padding: 0.75rem;
    }

    .upload-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.375rem;
    }

    .upload-icon svg {
        width: 18px;
        height: 18px;
    }

    .drop-text {
        font-size: 0.875rem;
    }
}

/* Scrollbar styling */
.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}