:root {
            --primary: #4f46e5;
            --primary-dark: #4338ca;
            --primary-light: #e0e7ff;
            --primary-gradient: linear-gradient(135deg, #4f46e5, #4338ca);
            --success: #059669;
            --success-light: #d1fae5;
            --warning: #d97706;
            --warning-light: #fef3c7;
            --error: #dc2626;
            --error-light: #fee2e2;
            --bg: #f8fafc;
            --surface: #ffffff;
            --text: #0f172a;
            --text-secondary: #475569;
            --text-tertiary: #94a3b8;
            --border: #e2e8f0;
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            scroll-behavior: smooth;
            -webkit-text-size-adjust: 100%;
        }

        body {
            font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        img {
            max-width: 100%;
            height: auto;
            display: block;
        }

        button, input, select, textarea {
            font-family: inherit;
        }

        /* Container */
        .container {
            width: 100%;
            max-width: 960px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        @media (min-width: 640px) {
            .container {
                padding: 0 1.5rem;
            }
        }

        @media (min-width: 1024px) {
            .container {
                padding: 0 2rem;
            }
        }

        /* Navbar */
        .navbar {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 40;
            backdrop-filter: blur(8px);
            background-color: rgba(255, 255, 255, 0.9);
        }

        .navbar-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 60px;
        }

        .logo {
            font-weight: 800;
            font-size: 1.25rem;
            color: var(--text);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            letter-spacing: -0.025em;
        }

        .logo i {
            color: var(--primary);
            font-size: 1.5rem;
        }

        .nav-badge {
            display: none;
            align-items: center;
            gap: 0.375rem;
            padding: 0.375rem 0.875rem;
            background: var(--success-light);
            color: var(--success);
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        @media (min-width: 640px) {
            .nav-badge {
                display: inline-flex;
            }
        }

        /* Hero */
        .hero {
            text-align: center;
            padding: 2.5rem 0 2rem;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 1rem;
            background: var(--primary-light);
            color: var(--primary-dark);
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 1rem;
        }

        .hero h1 {
            font-size: 1.875rem;
            font-weight: 800;
            letter-spacing: -0.03em;
            line-height: 1.15;
            color: var(--text);
        }

        @media (min-width: 640px) {
            .hero h1 {
                font-size: 2.25rem;
            }
        }

        @media (min-width: 1024px) {
            .hero h1 {
                font-size: 3rem;
            }
        }

        .hero .subtitle {
            color: var(--text-secondary);
            margin-top: 0.875rem;
            font-size: 1rem;
            max-width: 560px;
            margin-left: auto;
            margin-right: auto;
            line-height: 1.6;
        }

        /* Tool Card */
        .tool-card {
            background: var(--surface);
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-xl);
            border: 1px solid var(--border);
            overflow: hidden;
            padding: 1.5rem;
        }

        @media (min-width: 640px) {
            .tool-card {
                padding: 2rem;
            }
        }

        /* Upload Zone */
        .upload-zone {
            border: 2px dashed var(--border);
            border-radius: var(--radius-xl);
            padding: 2.5rem 1.5rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
            position: relative;
        }

        .upload-zone:hover,
        .upload-zone.drag-active {
            border-color: var(--primary);
            background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
        }

        .upload-zone .upload-icon {
            width: 56px;
            height: 56px;
            background: var(--primary-light);
            color: var(--primary);
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            font-size: 1.5rem;
            transition: transform 0.2s ease;
        }

        .upload-zone:hover .upload-icon {
            transform: scale(1.05);
        }

        .upload-zone h3 {
            font-size: 1.125rem;
            font-weight: 700;
            color: var(--text);
        }

        .upload-zone .upload-hint {
            font-size: 0.875rem;
            color: var(--text-secondary);
            margin-top: 0.375rem;
        }

        .upload-zone .upload-formats {
            font-size: 0.75rem;
            color: var(--text-tertiary);
            margin-top: 0.75rem;
            font-weight: 500;
        }

        .upload-zone input[type="file"] {
            display: none;
        }

        /* Preview */
        .preview-wrapper {
            display: none;
            margin-top: 1.25rem;
            animation: fadeIn 0.3s ease;
        }

        .preview-wrapper.active {
            display: block;
        }

        .preview-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }

        .file-meta {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: #f1f5f9;
            border-radius: 9999px;
            font-size: 0.8125rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .file-meta i {
            color: var(--primary);
        }

        .preview-image {
            max-width: 100%;
            max-height: 280px;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            object-fit: contain;
            background: #f8fafc;
            border: 1px solid var(--border);
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Controls */
        .controls {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        @media (min-width: 640px) {
            .controls {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }
        }

        .settings-group {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            align-items: center;
        }

        .settings-group label {
            font-size: 0.8125rem;
            font-weight: 600;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.375rem;
            white-space: nowrap;
        }

        .settings-group label i {
            color: var(--primary);
            font-size: 0.875rem;
        }

        .settings-group select {
            padding: 0.5rem 0.75rem;
            padding-right: 2rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            background: var(--surface);
            font-size: 0.8125rem;
            color: var(--text);
            cursor: pointer;
            outline: none;
            transition: all 0.2s;
            appearance: none;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
            background-position: right 0.5rem center;
            background-repeat: no-repeat;
            background-size: 1.25em;
        }

        .settings-group select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 0.875rem;
            border: none;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
            line-height: 1.5;
        }

        .btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }

        .btn-primary {
            background: var(--primary-gradient);
            color: white;
            box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
        }

        .btn-primary:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25);
        }

        .btn-primary:active:not(:disabled) {
            transform: translateY(0);
        }

        .btn-secondary {
            background: #f1f5f9;
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover:not(:disabled) {
            background: #e2e8f0;
            color: var(--text);
            border-color: #cbd5e1;
        }

        .btn-success {
            background: linear-gradient(135deg, var(--success), #047857);
            color: white;
            box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
        }

        .btn-success:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.25);
        }

        .btn-danger {
            background: var(--error-light);
            color: #991b1b;
            border: 1px solid #fecaca;
        }

        .btn-danger:hover:not(:disabled) {
            background: #fecaca;
        }

        .btn-sm {
            padding: 0.375rem 0.75rem;
            font-size: 0.75rem;
        }

        /* Progress */
        .progress-area {
            margin-top: 1.25rem;
        }

        .progress-track {
            width: 100%;
            height: 6px;
            background: #e2e8f0;
            border-radius: 9999px;
            overflow: hidden;
            display: none;
        }

        .progress-track.active {
            display: block;
        }

        .progress-fill {
            height: 100%;
            width: 0%;
            background: var(--primary-gradient);
            border-radius: 9999px;
            transition: width 0.3s ease;
        }

        .status-text {
            text-align: center;
            font-size: 0.875rem;
            font-weight: 600;
            margin-top: 0.625rem;
            display: none;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .status-text.active {
            display: flex;
        }

        /* Result Section */
        .result-section {
            margin-top: 1.5rem;
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            background: #fafafa;
            overflow: hidden;
            display: none;
        }

        .result-section.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .result-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            align-items: center;
            justify-content: space-between;
            padding: 0.875rem 1rem;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
        }

        .stats {
            display: flex;
            flex-wrap: wrap;
            gap: 0.875rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .stat {
            display: flex;
            align-items: center;
            gap: 0.375rem;
        }

        .stat strong {
            color: var(--primary);
            font-weight: 700;
        }

        .stat.confidence {
            display: none;
        }

        .stat.confidence.visible {
            display: flex;
        }

        .stat.confidence strong {
            color: var(--success);
        }

        .stat.confidence.medium strong {
            color: var(--warning);
        }

        .stat.confidence.low strong {
            color: var(--error);
        }

        /* Find & Replace */
        .find-replace-bar {
            display: none;
            padding: 0.875rem 1rem;
            background: #f8fafc;
            border-bottom: 1px solid var(--border);
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
            animation: slideDown 0.2s ease;
        }

        .find-replace-bar.active {
            display: flex;
        }

        .find-replace-bar input[type="text"] {
            flex: 1;
            min-width: 120px;
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 0.875rem;
            outline: none;
            transition: border-color 0.2s;
        }

        .find-replace-bar input[type="text"]:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
        }

        .regex-label {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
            cursor: pointer;
            white-space: nowrap;
            font-weight: 500;
        }

        .regex-label input {
            width: 14px;
            height: 14px;
            accent-color: var(--primary);
            cursor: pointer;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Text Tools */
        .text-tools {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            padding: 0.625rem 1rem;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
        }

        /* Textarea */
        .result-textarea {
            width: 100%;
            min-height: 240px;
            padding: 1rem;
            border: none;
            background: transparent;
            font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
            font-size: 0.875rem;
            line-height: 1.7;
            color: var(--text);
            resize: vertical;
            outline: none;
        }

        .result-textarea::placeholder {
            color: var(--text-tertiary);
        }

        /* Result Actions */
        .result-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            justify-content: flex-end;
            padding: 0.875rem 1rem;
            background: var(--surface);
            border-top: 1px solid var(--border);
        }

        /* Steps */
        .steps-section {
            margin-top: 3rem;
        }

        .steps-section h2 {
            text-align: center;
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--text);
        }

        .steps-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }

        @media (min-width: 768px) {
            .steps-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .step {
            text-align: center;
            padding: 1.5rem 1rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            transition: box-shadow 0.2s, transform 0.2s;
        }

        .step:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            border-color: #cbd5e1;
        }

        .step-number {
            width: 36px;
            height: 36px;
            background: var(--primary-gradient);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            margin: 0 auto 0.75rem;
            font-size: 0.875rem;
            box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
        }

        .step h4 {
            font-size: 0.9375rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 0.375rem;
        }

        .step p {
            font-size: 0.8125rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        /* Features */
        .features-section {
            margin-top: 3rem;
        }

        .features-section h2 {
            text-align: center;
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--text);
        }

        .features-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        @media (min-width: 640px) {
            .features-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .features-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .feature-card {
            background: var(--surface);
            padding: 1.5rem;
            border-radius: var(--radius-xl);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.2s, transform 0.2s;
        }

        .feature-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            border-color: #cbd5e1;
        }

        .feature-icon {
            width: 44px;
            height: 44px;
            background: var(--primary-light);
            color: var(--primary);
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.125rem;
            margin-bottom: 1rem;
        }

        .feature-card h3 {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--text);
        }

        .feature-card p {
            font-size: 0.8125rem;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        /* FAQ */
        .faq-section {
            margin-top: 3rem;
            background: var(--surface);
            border-radius: var(--radius-2xl);
            padding: 1.5rem;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        @media (min-width: 640px) {
            .faq-section {
                padding: 2rem;
            }
        }

        .faq-section h2 {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            text-align: center;
            color: var(--text);
        }

        .faq-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .faq-item {
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .faq-item:hover {
            border-color: #cbd5e1;
        }

        .faq-item.active {
            border-color: var(--primary);
            box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.05);
        }

        .faq-question {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.25rem;
            background: none;
            border: none;
            font-size: 0.9375rem;
            font-weight: 600;
            color: var(--text);
            cursor: pointer;
            text-align: left;
            transition: color 0.2s;
        }

        .faq-question:hover {
            color: var(--primary);
        }

        .faq-question i {
            transition: transform 0.3s ease;
            color: var(--text-tertiary);
            font-size: 0.875rem;
            flex-shrink: 0;
            margin-left: 0.75rem;
        }

        .faq-item.active .faq-question i {
            transform: rotate(180deg);
            color: var(--primary);
        }

        .faq-answer {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.35s ease, padding 0.35s ease;
            padding: 0 1.25rem;
            color: var(--text-secondary);
            font-size: 0.875rem;
            line-height: 1.7;
        }

        .faq-item.active .faq-answer {
            max-height: 300px;
            padding: 0 1.25rem 1.25rem;
        }

        /* SEO Content */
        .seo-content {
            margin-top: 3rem;
            padding: 1.5rem;
            background: var(--surface);
            border-radius: var(--radius-2xl);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        @media (min-width: 640px) {
            .seo-content {
                padding: 2rem;
            }
        }

        .seo-content h2 {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary);
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
        }

        .seo-content h2:first-child {
            margin-top: 0;
        }

        .seo-content h3 {
            font-size: 1.05rem;
            font-weight: 600;
            color: var(--text);
            margin-top: 1.25rem;
            margin-bottom: 0.5rem;
        }

        .seo-content p,
        .seo-content li {
            font-size: 0.875rem;
            color: var(--text-secondary);
            line-height: 1.8;
            margin-bottom: 0.875rem;
        }

        .seo-content ul {
            margin-left: 1.25rem;
            margin-bottom: 1rem;
        }

        .seo-content li {
            margin-bottom: 0.5rem;
        }

        .seo-content strong {
            color: var(--text);
            font-weight: 600;
        }

        /* Footer */
        .footer {
            margin-top: 4rem;
            padding: 2rem 0;
            text-align: center;
            border-top: 1px solid var(--border);
            color: var(--text-tertiary);
            font-size: 0.875rem;
            background: var(--surface);
        }

        .footer a {
            color: var(--text-secondary);
            text-decoration: none;
            font-weight: 500;
        }

        .footer a:hover {
            color: var(--primary);
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            background: var(--text);
            color: white;
            padding: 0.875rem 1.25rem;
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 500;
            box-shadow: var(--shadow-xl);
            z-index: 50;
            transform: translateX(150%);
            transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            max-width: 90vw;
        }

        .toast.show {
            transform: translateX(0);
        }

        .toast.error {
            background: var(--error);
        }

        .toast.success {
            background: var(--success);
        }

        /* Utility */
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border-width: 0;
        }

        /* Mobile refinements */
        @media (max-width: 480px) {
            .hero {
                padding: 1.5rem 0 1.25rem;
            }
            
            .hero h1 {
                font-size: 1.625rem;
            }
            
            .tool-card {
                padding: 1.25rem;
                border-radius: var(--radius-xl);
            }
            
            .upload-zone {
                padding: 2rem 1rem;
            }
            
            .upload-zone h3 {
                font-size: 1rem;
            }
            
            .settings-group {
                width: 100%;
            }
            
            .settings-group select {
                flex: 1;
                min-width: 0;
            }
            
            .btn {
                width: 100%;
            }
            
            .result-actions {
                justify-content: stretch;
            }
            
            .result-actions .btn {
                flex: 1;
            }
            
            .text-tools {
                justify-content: stretch;
            }
            
            .text-tools .btn {
                flex: 1;
            }
            
            .find-replace-bar input[type="text"] {
                width: 100%;
            }
        }

/* Tool Navigation - Simple & Clean */
.tool-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0 1.5rem;
    padding: 0;
    width: 100%;
}

.tool-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.tool-nav-link:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #eef2ff;
    transform: translateY(-1px);
}

.tool-nav-link.active {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.tool-nav-link i {
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .tool-nav {
        gap: 0.5rem;
        margin: 1.5rem 0 1rem;
    }
    
    .tool-nav-link {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .tool-nav {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .tool-nav-link {
        justify-content: center;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: 12px;
        width: 100%;
    }
}


/* Fix uploaded image on mobile - fit container */
@media (max-width: 768px) {
    .preview-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 320px;
        object-fit: contain;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .preview-image {
        max-height: 250px;
        border-radius: var(--radius-sm);
    }
    
    .preview-wrapper {
        margin-top: 0.75rem;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .file-meta {
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        white-space: normal;
        word-break: break-word;
        text-align: center;
    }
    
    .preview-header .btn {
        width: 100%;
        justify-content: center;
    }
}
/* Force nav buttons in one line on mobile */
@media (max-width: 640px) {
    .tool-nav {
        gap: 0.375rem;
        margin: 1rem 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.25rem 0;
    }
    
    .tool-nav::-webkit-scrollbar {
        display: none;
    }
    
    .tool-nav-link {
        flex: 0 0 auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
        min-width: auto;
        width: auto;
        border-radius: 50px;
    }
}

@media (max-width: 480px) {
    .tool-nav {
        gap: 0.25rem;
        padding: 0.125rem 0;
    }
    
    .tool-nav-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.7rem;
        gap: 0.375rem;
    }
    
    .tool-nav-link i {
        font-size: 0.7rem;
    }
}