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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, #ff3366 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, #33ccff 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, #ffcc33 0%, transparent 50%);
    opacity: 0.1;
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.main-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ff3366, #33ccff, #ffcc33);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1rem;
    color: #888;
    font-weight: 300;
    letter-spacing: 1px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff3366, transparent);
    transition: left 0.6s ease;
}

.action-card:hover::before {
    left: 100%;
}

.action-card:hover {
    transform: translateY(-10px);
    border-color: #ff3366;
    box-shadow: 0 20px 40px rgba(255, 51, 102, 0.2);
}

.action-card:nth-child(2):hover {
    border-color: #33ccff;
    box-shadow: 0 20px 40px rgba(51, 204, 255, 0.2);
}

.action-card:nth-child(3):hover {
    border-color: #ffcc33;
    box-shadow: 0 20px 40px rgba(255, 204, 51, 0.2);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #ff3366, #ff6699);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

.action-card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #33ccff, #66d9ff);
}

.action-card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #ffcc33, #ffdd66);
}

.action-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.card-description {
    color: #bbb;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.card-meta {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

.query-section {
    background: linear-gradient(145deg, #111, #222);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    position: relative;
}

.query-section::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #ff3366, #33ccff, #ffcc33);
    background-size: 300% 300%;
    border-radius: 24px;
    z-index: -1;
    animation: borderGlow 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.query-section:hover::after {
    opacity: 1;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Input container default */
.input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Hover effect for the whole container */
.input-container:hover {
    border-color: #4dafff;
    background: rgba(77, 175, 255, 0.08);
    box-shadow: 0 0 15px rgba(77, 175, 255, 0.4);
    transform: translateY(-3px);
}

.query-input {
    flex: 1;
    background: #000;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 18px;
    font-size: 1rem;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.query-input::placeholder {
    color: #666;
}

.query-input:focus {
    border-color: #ff3366;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.submit-btn {
    background: linear-gradient(135deg, #ff3366, #ff6699);
    border: none;
    border-radius: 12px;
    width: 55px;
    height: 55px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.submit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.4);
}

.results-area {
    background: linear-gradient(135deg, #0f0f0f, #1f1f1f);
    border: 2px solid #333;
    border-radius: 24px;
    padding: 60px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.results-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.1), transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

.results-text {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
}

/* Utility: hide arbitrary elements (but not modals to preserve fade transitions) */
.hidden:not(.modal) {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 2px solid #333;
    border-radius: 20px;
    padding: 35px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: float 3s ease-in-out infinite;
}

/* Add more space between modal elements */
.modal-content > *:not(:last-child) {
    margin-bottom: 20px; /* uniform spacing */
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* Header icon for modals */
.modal-header-icon {
    color: #ff6699;
    font-size: 1.2rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff3366, #ff6699);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.4);
}

.modal-input {
    width: 100%;
    background: #000;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 16px 15px 12px; /* extra top padding for consistent first-line alignment */
    font-size: 1rem;
    line-height: 1.4; /* stabilize text vertical metrics */
    color: #fff;
    margin-bottom: 15px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.modal-input:focus {
    border-color: #ff3366;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

/* Hover glow + subtle scale like buttons */
.modal-input:hover {
    background: linear-gradient(145deg, #0d0d0d, #1c1c1c);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.35), 0 0 40px rgba(51, 204, 255, 0.2);
    transform: scale(1.02);
}

.modal-input::placeholder {
    color: #666;
}

.modal-input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 16px; /* align with first text line (matches input top padding) */
    transform: none;
    color: #666;
    font-size: 1.2rem;
    pointer-events: none; /* allow clicks to focus the input */
    transition: color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

/* Ensure textarea placeholder aligns with the same row as inputs */
.modal-input-group textarea.modal-input {
    padding-top: 16px;
    line-height: 1.4;
}

.modal-input-group .modal-input {
    padding-left: 48px; /* extra space so text doesn't crowd the icon */
}

.drop-zone {
    background: linear-gradient(145deg, #111, #222);
    border: 2px dashed #444;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    min-height: 150px;
    font-size: 1.1rem;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.drop-zone:hover {
    border-color: #ff3366;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.35), 0 0 40px rgba(51, 204, 255, 0.2);
    transform: scale(1.02);
}

/* Dragover visual state (from JS toggling is-dragover) */
.drop-zone.is-dragover {
    border-color: #ff3366;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.dz-invite {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.dz-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.file-list {
    list-style: none;
    color: #bbb;
    margin-top: 10px;
    padding-left: 0;
}

.progress-container {
    margin-top: 20px;
    background: #000;
    border-radius: 8px;
    padding: 15px;
}

.progress-label {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.progress-track {
    background: #333;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #ff3366, #ff6699);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-bar.error {
    background: linear-gradient(135deg, #ff3366, #cc3333) !important;
}

.modal-note {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

.modal-btn {
    background: linear-gradient(135deg, #ff3366, #ff6699);
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.4);
}

.gradient-text {
    background: linear-gradient(135deg, #ff3366, #33ccff, #ffcc33);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 3s ease-in-out infinite;
}

/* Results panel and summary cards (ported from frontend, adapted to this theme) */
#results {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: #ffffff;
    transition: background 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}

#results:hover {
    background: linear-gradient(145deg, #0d0d0d, #1c1c1c);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.25), 0 0 40px rgba(51, 204, 255, 0.25);
    transform: scale(1.02);
}

/* Horizontal strip for document summary cards */
#results .summary-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Summary cards */
#results .summary-card {
    background: linear-gradient(135deg, #0f0f0f, #1f1f1f);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 1rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    min-width: 280px;
    scroll-snap-align: start;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

#results .summary-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: #ff3366;
    box-shadow: 0 10px 25px rgba(255, 51, 102, 0.25);
}

/* Only affect Quick Summary results */
#summary-output .summary-grid {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;   /* enables horizontal scrolling */
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory; /* optional smooth snapping */
}

/* Wider cards only inside Quick Summary */
#summary-output .summary-card {
    flex: 0 0 1000px;    /* fixed width for each card */
    max-width: 1000px;
    scroll-snap-align: start;
}

/* Results panel default text */
.results-area {
    color: #ffffff; /* soft white-blue default text */
}

/* Headings in results */
.results-area h2,
.results-area h3,
.results-area h4,
.results-area strong {
    color: #a5d8ff; /* light blue headings */
}

/* Gradient text override for results */
.results-area .gradient-text {
    background: linear-gradient(90deg, #4dafff, #e6f2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* fallback so no error */
}

/* Card content text */
.results-area .card-content,
.results-area p,
.results-area li,
.results-area span {
    color: #ffffff; /* softer white-blue for body */
}

/* Default typewriter + glow for larger screens */
.subtitle {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #4dafff;
    font-size: 1.2rem;
    font-weight: 600;
    color: #a5d8ff;
    animation: typing 3s steps(30, end), 
               blink 0.7s step-end 3s, 
               glowPulse 2s ease-in-out 3s infinite;
    animation-fill-mode: forwards;
}

/* Typing animation */
@keyframes typing {
    from { width: 0 }
    to { width: 40% }
}

/* Cursor blink */
@keyframes blink {
    50% { border-color: transparent }
    100% { border-color: transparent }
}

/* Glow pulse effect */
@keyframes glowPulse {
    0%, 100% {
      color: #a5d8ff;
      text-shadow: 0 0 0px #4dafff;
    }
    50% {
      color: #ffffff;
      text-shadow: 0 0 20px #4dafff, 0 0 40px #1e90ff;
    }
}

/* 📱 On small screens (mobile) → replace with scrolling marquee */
@media (max-width: 600px) {
    .subtitle {
      border-right: none;  /* remove typewriter cursor */
      width: 100%;
      overflow: hidden;
      white-space: nowrap;
      display: block;
      animation: scrollText 8s linear infinite; /* continuous scrolling */
    }

    @keyframes scrollText {
      from { transform: translateX(100%); }
      to   { transform: translateX(-100%); }
    }
}

/* Pause marquee on hover/tap (mobile scrolling only) */
@media (max-width: 600px) {
    .subtitle:hover {
      animation-play-state: paused;
    }
}

/* Lists inside cards */
#results .summary-card ul {
    list-style: disc;
    list-style-position: outside;
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

#results .summary-card ul ul {
    list-style: circle;
    padding-left: 1.25rem;
    margin: 0.25rem 0;
}

#results .summary-card li {
    margin: 0.25rem 0;
}

#results .summary-card li::marker {
    color: #cccccc;
}

/* Card headers and copy buttons */
#results .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

#results .copy-btn {
    background: rgba(0,0,0,0.3);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #ffffff;
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

#results .copy-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 12px rgba(51, 204, 255, 0.3);
}

#results .copy-btn.success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* Spinner / Thinking */
#results .thinking {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

#results .spinner-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.25);
    border-top-color: #33ccff;
    animation: spin 1s linear infinite;
}

#results .thinking .msg {
    font-weight: 800;
    color: #33ccff;
}

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

/* Analyze Modal Theming (Blue) */
#aModal .modal-header-icon {
    color: #33ccff;
}

#aModal .modal-close {
    background: linear-gradient(135deg, #33ccff, #66d9ff);
}

#aModal .modal-close:hover {
    box-shadow: 0 5px 15px rgba(51, 204, 255, 0.4);
}

#aModal .modal-btn {
    background: linear-gradient(135deg, #33ccff, #66d9ff);
}

#aModal .modal-btn:hover {
    box-shadow: 0 5px 15px rgba(51, 204, 255, 0.4);
}

#aModal .modal-input:focus {
    border-color: #33ccff;
    box-shadow: 0 0 15px rgba(51, 204, 255, 0.3);
}

#aModal .modal-input:hover {
    box-shadow: 0 0 20px rgba(51, 204, 255, 0.35), 0 0 40px rgba(51, 204, 255, 0.2);
}

#aModal .progress-bar {
    background: linear-gradient(135deg, #33ccff, #66d9ff);
}

/* Make icon react when the Analyze input group is hovered or focused */
#aModal .modal-input-group:hover .input-icon,
#aModal .modal-input-group:focus-within .input-icon {
    color: #66d9ff;
    filter: drop-shadow(0 0 6px rgba(51, 204, 255, 0.45));
}

/* Make the input border and placeholder react with the icon */
#aModal .modal-input-group:hover .modal-input,
#aModal .modal-input-group:focus-within .modal-input {
    border-color: #33ccff;
    box-shadow: 0 0 20px rgba(51, 204, 255, 0.35), 0 0 40px rgba(51, 204, 255, 0.2);
}

#aModal .modal-input::placeholder {
    color: rgba(102, 217, 255, 0.65);
    transition: color 0.2s ease;
}

#aModal .modal-input-group:hover .modal-input::placeholder,
#aModal .modal-input-group:focus-within .modal-input::placeholder {
    color: rgba(102, 217, 255, 0.9);
}

/* Analyze modal: grid layout for icon + input when using a-field */
#aModal .a-field {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    gap: 12px;
}

#aModal .a-field .input-icon {
    position: static;
    left: auto;
    top: auto;
    font-size: 1.1rem;
    color: #99e6ff;
}

#aModal .a-field .modal-input {
    padding-left: 12px; /* override absolute-icon padding */
}

#aModal .a-field:hover .input-icon,
#aModal .a-field:focus-within .input-icon {
    color: #66d9ff;
    filter: drop-shadow(0 0 6px rgba(51, 204, 255, 0.45));
}

#aModal .a-field:hover .modal-input,
#aModal .a-field:focus-within .modal-input {
    border-color: #33ccff;
    box-shadow: 0 0 20px rgba(51, 204, 255, 0.35), 0 0 40px rgba(51, 204, 255, 0.2);
}

#aModal .a-field:hover .modal-input::placeholder,
#aModal .a-field:focus-within .modal-input::placeholder {
    color: rgba(102, 217, 255, 0.9);
}

@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .query-section {
        padding: 30px 20px;
    }
    .results-area {
        padding: 40px 20px;
    }
    .header {
        margin-bottom: 40px;
    }
    .modal-content {
        padding: 20px;
    }

    /* Make action cards full width on mobile */
    .action-grid {
      grid-template-columns: 1fr;
    }
    .action-card {
        padding: 20px;
    }
    .drop-zone {
        padding: 20px;
        min-height: 120px;
    }
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    /* Reduce results panel padding for mobile */
    .results-area {
        padding: 20px;
    }
    /* Adjust summary cards for mobile */
    #summary-output .summary-card {
        flex: 0 0 90%;   /* each card takes ~90% of screen width */
        max-width: 90%;
    }
    /* Stack input field & button vertically */
    .input-container {
        flex-direction: column;
        align-items: stretch;
    }
    .query-input {
        width: 100%;
        margin-bottom: 10px;
    }
    .submit-btn {
        width: 100%;
        height: 45px;
    }
}

@media (max-width: 640px) {
    .modal {
        display: block; /* Override flex to ensure full-screen mobile behavior */
        align-items: stretch; /* Ensure content stretches vertically */
        padding: 0; /* Remove padding to maximize space */
        backdrop-filter: blur(3px); /* Slightly reduce blur for performance */
        transition: none; /* Disable transitions to prevent desktop view flash */
    }
    .modal:not(.hidden) {
        opacity: 1;
        visibility: visible;
        transition: none; /* Ensure immediate rendering */
    }
    .modal-content {
        width: 100vw; /* Full viewport width */
        max-width: none; /* Remove max-width constraint */
        height: 100vh; /* Full viewport height */
        margin: 0; /* Remove margins */
        padding: 15px; /* Reduced padding for mobile */
        border-radius: 0; /* Remove border-radius for edge-to-edge look */
        box-shadow: none; /* Remove shadow for cleaner mobile appearance */
        overflow-y: auto; /* Allow scrolling for long content */
        animation: none; /* Disable float animation to prevent layout shifts */
    }
    .modal-header {
        margin-bottom: 15px; /* Slightly reduce spacing */
    }
    .modal-title {
        font-size: 1.3rem; /* Smaller title for mobile */
    }
    .modal-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    .modal-input {
        font-size: 0.95rem; /* Slightly smaller font */
        padding: 12px 15px 10px; /* Adjusted padding */
    }
    .modal-input-group .modal-input {
        padding-left: 40px; /* Adjust for smaller icon */
    }
    .input-icon {
        font-size: 1rem; /* Smaller icon */
        top: 14px; /* Adjust vertical alignment */
        left: 10px;
    }
    .drop-zone {
        padding: 15px; /* Reduced padding */
        min-height: 100px; /* Smaller drop zone */
        font-size: 1rem; /* Smaller text */
    }
    .dz-invite {
        font-size: 1rem; /* Smaller invite text */
    }
    .dz-hint {
        font-size: 0.85rem; /* Smaller hint text */
    }
    .modal-btn {
        padding: 8px 15px; /* Smaller button padding */
        font-size: 0.95rem; /* Smaller button text */
    }
    .progress-container {
        padding: 10px; /* Smaller padding */
    }
    .progress-label {
        font-size: 0.85rem; /* Smaller label */
    }
    .progress-track {
        height: 6px; /* Thinner progress bar */
    }
    /* Ensure Analyze modal inputs are mobile-friendly */
    #aModal .a-field {
        grid-template-columns: 28px 1fr; /* Smaller icon column */
        gap: 10px; /* Smaller gap */
    }
    #aModal .a-field .modal-input {
        padding-left: 10px; /* Adjust padding */
    }
    #aModal .a-field .input-icon {
        font-size: 1rem; /* Smaller icon */
    }
}