        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background: #f0f4fa;
            color: #1a2c3e;
            line-height: 1.5;
        }

        .site-header {
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .header-container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            text-decoration: none;
            font-weight: 700;
            font-size: 1.125rem;
            color: #1a2c3e;
        }
        .logo-mark {
            background: linear-gradient(135deg, #2c5a7a, #3b82b6);
            width: 32px;
            height: 32px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 0.9rem;
        }
        .nav {
            display: flex;
            gap: 1.25rem;
            flex-wrap: wrap;
        }
        .nav a {
            color: #4a627a;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 500;
            transition: color 0.2s;
        }
        .nav a:hover { color: #3b82b6; }

        .main {
            max-width: 1280px;
            margin: 0 auto;
            padding: 1.5rem;
        }

        .hero {
            margin-bottom: 2rem;
            padding: 1rem 0;
        }
        .hero h1 {
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: -0.02em;
            color: #1a2c3e;
            margin-bottom: 0.5rem;
        }
        .hero p {
            color: #4a627a;
            font-size: 0.95rem;
            max-width: 560px;
        }

        .tool-container {
            background: white;
            border-radius: 2rem;
            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.02);
            overflow: hidden;
        }
        #workSpaceHeaderIsh {
            font-size: 0.65rem;
            color: #6b85a0;
            margin-top: 0.3rem;
        }
        #fileInput {
            display: none;
        }
        #progressMsg {
            font-size: 0.75rem;
            text-align: center;
            margin-top: 0.75rem;
            color: #4a627a;
        }
        #spinnerElem {
            display:none;
        }

        .upload-zone {
            padding: 2.5rem 1.5rem;
            text-align: center;
            background: linear-gradient(145deg, #ffffff, #fafcff);
            border-bottom: 1px solid #e6edf4;
            cursor: pointer;
            transition: all 0.2s;
        }
        .upload-zone:hover { background: #ffffff; }
        .upload-zone.drag-over { background: #eef4fc; }
        .upload-icon { margin-bottom: 1rem; }
        .upload-text { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; color: #3b82b6; }
        .upload-hint { font-size: 0.75rem; color: #6b85a0; }

        .workspace { display: none; }
        .workspace.active { display: block; }

        .compression-dashboard {
            display: grid;
            grid-template-columns: 1fr 1.2fr 1fr;
            gap: 0;
            background: white;
        }
        @media (max-width: 880px) {
            .compression-dashboard { grid-template-columns: 1fr; }
        }

        .preview-col {
            background: #fafdff;
            padding: 1.5rem;
            border-right: 1px solid #e6edf4;
        }
        .preview-title {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #3b82b6;
            margin-bottom: 1rem;
        }
        .preview-frame {
            background: white;
            border-radius: 1rem;
            padding: 1rem;
            text-align: center;
            border: 1px solid #e6edf4;
            min-height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .preview-frame img {
            max-width: 100%;
            max-height: 180px;
            border-radius: 8px;
            object-fit: contain;
        }
        .doc-stats {
            margin-top: 1rem;
            background: white;
            border-radius: 1rem;
            padding: 0.75rem;
            border: 1px solid #e6edf4;
        }
        .stat-item {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid #f0f4fa;
        }
        .stat-item:last-child { border: none; }
        .stat-label { color: #6b85a0; font-weight: 500; }
        .stat-value { font-weight: 600; color: #1a2c3e; }

        .controls-col {
            padding: 1.5rem;
            background: white;
            border-right: 1px solid #e6edf4;
        }
        .control-group {
            margin-bottom: 1.5rem;
        }
        .control-label {
            font-weight: 600;
            font-size: 0.8rem;
            margin-bottom: 0.5rem;
            display: flex;
            justify-content: space-between;
            color: #2c4e6e;
        }
        input[type="range"] {
            width: 100%;
            height: 4px;
            background: #e2eaf1;
            border-radius: 2px;
            -webkit-appearance: none;
        }
        input[type="range"]::-webkit-slider-thumb {
            width: 16px;
            height: 16px;
            background: #3b82b6;
            border-radius: 50%;
            cursor: pointer;
        }
        .preset-buttons {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }
        .preset {
            font-size: 0.7rem;
            padding: 0.25rem 0.6rem;
            background: #f0f4fa;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .preset:hover { background: #e2eaf1; }
        .toggle-switch {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #f8fafd;
            padding: 0.6rem 0.8rem;
            border-radius: 1rem;
            margin-top: 0.5rem;
        }
        .toggle-label {
            font-size: 0.8rem;
            font-weight: 500;
        }
        .toggle-btn {
            width: 40px;
            height: 22px;
            background: #cbdae9;
            border-radius: 30px;
            cursor: pointer;
            position: relative;
            transition: 0.2s;
        }
        .toggle-btn.active {
            background: #3b82b6;
        }
        .toggle-btn::after {
            content: '';
            width: 18px;
            height: 18px;
            background: white;
            border-radius: 50%;
            position: absolute;
            top: 2px;
            left: 2px;
            transition: 0.2s;
        }
        .toggle-btn.active::after {
            left: 20px;
        }

        .size-col {
            padding: 1.5rem;
            background: linear-gradient(135deg, #fafdff, #ffffff);
            display: flex;
            flex-direction: column;
        }
        .size-header {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #3b82b6;
            margin-bottom: 1rem;
        }
        .comparison-card {
            background: white;
            border-radius: 1.25rem;
            padding: 1.2rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.02);
            border: 1px solid #e6edf4;
            margin-bottom: 1rem;
        }
        .size-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 0.75rem 0;
            border-bottom: 1px dashed #e6edf4;
        }
        .size-row:last-child { border: none; }
        .size-label {
            font-size: 0.75rem;
            color: #6b85a0;
        }
        .size-number {
            font-size: 1.2rem;
            font-weight: 700;
            color: #1a2c3e;
        }
        .savings-badge {
            background: #eef4fc;
            border-radius: 1rem;
            padding: 0.75rem;
            text-align: center;
            margin-top: 0.5rem;
        }
        #savingsBadgeDiv {
            font-size: 0.7rem;
        }
        .savings-percent {
            font-size: 1.5rem;
            font-weight: 800;
            color: #3b82b6;
        }
        .filename-area {
            margin: 1rem 0;
        }
        .filename-area label {
            font-size: 0.7rem;
            font-weight: 500;
            color: #6b85a0;
            display: block;
            margin-bottom: 0.3rem;
        }
        .filename-area input {
            width: 100%;
            padding: 0.6rem 0.8rem;
            border: 1px solid #d4e0ec;
            border-radius: 3rem;
            font-size: 0.75rem;
            font-family: inherit;
            background: white;
        }
        .compress-action {
            margin-top: 0.5rem;
        }
        .btn-compress {
            width: 100%;
            background: #3b82b6;
            color: white;
            padding: 0.75rem;
            border: none;
            border-radius: 3rem;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .btn-compress:hover:not(:disabled) {
            background: #2c5a7a;
            transform: translateY(-1px);
        }
        .btn-compress:disabled {
            opacity: 0.6;
            cursor: wait;
        }
        .btn-secondary {
            width: 100%;
            background: #f0f4fa;
            color: #4a627a;
            padding: 0.6rem;
            border: 1px solid #d4e0ec;
            border-radius: 3rem;
            font-weight: 500;
            font-size: 0.75rem;
            cursor: pointer;
            margin-top: 0.5rem;
        }
.result-area {
    border-top: 1px solid #e6edf4;
    padding: 1.5rem;
    text-align: center;
    background: #eef4fc;
    display: none;
}

.result-area.active {
    display: block;
}

.result-icon {
    font-size: 2rem;
}

.result-title {
    font-weight: 600;
    margin: 0.5rem 0;
}

.result-stats-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.result-download-btn {
    width: auto;
    padding: 0.6rem 2rem;
    margin: 0 auto;
}

.result-new-btn {
    margin-top: 0.75rem;
    width: auto;
}

.error-area {
    border-top: 1px solid #fee2e2;
    padding: 1.5rem;
    text-align: center;
    background: #fef6f5;
    display: none;
}

.error-area.active {
    display: block;
}

.error-title {
    font-weight: 600;
}

.error-message {
    font-size: 0.75rem;
    margin: 0.5rem 0;
}

        .progress-area {
            border-top: 1px solid #e6edf4;
            padding: 1.5rem;
            background: #fafdff;
            display: none;
        }
        .progress-area.active { display: block; }
        .progress-bar {
            height: 6px;
            background: #e2eaf1;
            border-radius: 3px;
            overflow: hidden;
        }
        .progress-fill {
            background: #3b82b6;
            width: 0%;
            height: 100%;
            transition: width 0.25s;
        }

        .result-area {
            border-top: 1px solid #e6edf4;
            padding: 1.5rem;
            text-align: center;
            background: #eef4fc;
            display: none;
        }
        .result-area.active { display: block; }
        .error-area {
            border-top: 1px solid #fee2e2;
            padding: 1.5rem;
            text-align: center;
            background: #fef6f5;
            display: none;
        }
        .error-area.active { display: block; }

        /* Mixed content layout: cards + table + highlight */
        .knowledge-section {
            margin-top: 2.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }
        .insight-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.25rem;
        }
        .insight-card {
            background: white;
            border-radius: 1.25rem;
            padding: 1.2rem;
            border: 1px solid #e6edf4;
            transition: all 0.2s;
        }
        .insight-card h3 {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 0.6rem;
            color: #2c5a7a;
        }
        .insight-card p, .insight-card li {
            font-size: 0.8rem;
            color: #4a627a;
            line-height: 1.5;
        }
        .insight-card ul {
            padding-left: 1.2rem;
            margin-top: 0.3rem;
        }
        .settings-table {
            background: white;
            border-radius: 1.25rem;
            padding: 1.2rem;
            border: 1px solid #e6edf4;
            overflow-x: auto;
        }
        .settings-table h3 {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 1rem;
            color: #2c5a7a;
        }
        .scenario-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 1rem;
        }
        .scenario-item {
            background: #f8fafd;
            padding: 0.8rem;
            border-radius: 1rem;
            border-left: 3px solid #3b82b6;
        }
        .scenario-item strong {
            font-size: 0.8rem;
            color: #1a2c3e;
        }
        .scenario-item p {
            font-size: 0.7rem;
            color: #6b85a0;
            margin-top: 0.2rem;
        }
        .interactive-tip {
            background: #eef4fc;
            border-radius: 1rem;
            padding: 1rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: space-between;
        }
        .interactive-tip p {
            font-size: 0.8rem;
            color: #2c5a7a;
            margin: 0;
        }
        .tip-badge {
            background: #3b82b6;
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 2rem;
            font-size: 0.7rem;
            font-weight: 500;
        }
        .footer-note {
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid #dce5ef;
            font-size: 0.7rem;
            text-align: center;
            color: #6b85a0;
        }
        .toast {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            background: #1a2c3e;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.75rem;
            transform: translateX(400px);
            transition: transform 0.2s;
            z-index: 200;
        }
        .spinner {
            width: 14px;
            height: 14px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            display: inline-block;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .hidden { display: none; }

        #footerSpan {
            margin-left: 1rem;
        }

        .footerLink {
            color: #3b82b6;
            text-decoration: none;
        }