        /* ============ BASE ============ */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: Vazirmatn, system-ui, sans-serif;
            background: #f3f4f6;
            color: #333;
            text-align: center;
            overflow-x: hidden;
            font-size: 15px;
            line-height: 1.8;
        }

        /* ============ INTRO ============ */
        #intro {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: #f3f4f6;
            transition: opacity .4s ease, transform .4s ease;
        }

        #intro.hide {
            opacity: 0;
            transform: scale(1.03);
        }

        .panel {
            position: absolute;
            width: 50%;
            height: 100%;
            background: #b40000;
            transition: transform .7s ease;
        }

        .panel.left {
            left: 0;
        }

        .panel.right {
            right: 0;
        }

        .intro-logo {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 160px;
            transform: translate(-50%, -50%) scale(1.4);
            transition: transform .6s ease;
            z-index: 2;
        }

        /* ============ HERO ============ */
        .hero {
            padding: 5rem 1.5rem 1rem;
            display: flex;
            justify-content: center;
        }

        .hero-box {
            background: #fafafa;
            border: 1px solid #e1e1e1;
            border-radius: 18px;
            padding: 1rem 1rem;
            max-width: 1050px;
            width: 100%;
        }


        .hero-row {
            display: grid;
            grid-template-areas: "logo1 text logo2";
            grid-template-columns: auto 1fr auto;
            align-items: center;
            gap: 2rem;
            max-width: 900px;
            margin: 0 auto;
        }

        .logo-1 {
            grid-area: logo1;
        }

        .logo-2 {
            grid-area: logo2;
        }

        .hero-text {
            grid-area: text;
        }

        .hero-logo {
            height: 120px;
        }

        .hero-text {
            font-size: 1.05rem;
            line-height: 1.6;
        }

        .hero-text {
            text-align: center;
            max-width: 420px;
            margin: 0 auto;
        }


        /* ============ CARDS ============ */
        .cards {
            max-width: 1100px;
            margin: 0 auto;
            padding: 2.5rem 1.5rem 4rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 1.5rem;
        }

        .card {
            background: #fafafa;
            border: 1px solid #dedede;
            border-radius: 16px;
            padding: 1.6rem;
            opacity: 0;
            transform: translateY(18px);
            transition: .6s ease;
        }

        .card.show {
            opacity: 1;
            transform: translateY(0);
        }

        .card h3 {
            font-size: .95rem;
            margin-bottom: .75rem;
            color: #333;
            position: relative;
            display: inline-block;
            padding: .45rem .8rem .45rem 1rem;
            border-radius: 10px;
            background: linear-gradient(90deg, rgba(180,0,0,0.06) 0%, rgba(0,0,0,0) 60%);
            border-left: 4px solid #b40000;
            box-shadow: 0 6px 12px rgba(0,0,0,0.04);
        }

        .card h3::after {
            content: '';
            position: absolute;
            left: 0;
            right: -0.6rem;
            height: 2px;
            bottom: -10px;
            background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0));
            border-radius: 2px;
        }

        .card p {
            font-size: .88rem;
            color: #555;
            margin-bottom: 1.2rem;
        }

        /* ===== Download Button ===== */
        .card a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            padding: .5rem .9rem;
            min-height: 44px;
            border: 1px solid #d0d0d0;
            border-radius: 10px;
            font-size: .9rem;
            color: #111;
            text-decoration: none;
            text-align: center;
            background: #ffffff;
            box-shadow: 0 6px 12px rgba(0,0,0,0.04);
            transition: transform .36s ease, box-shadow .36s ease, background .36s ease;
            will-change: transform;
            position: relative;
            overflow: hidden;
            --progress: 0%;
        }
        /* add spacing between stacked download buttons */
        .card a.download { margin-bottom: 0.7rem; }

        /* PDF badge */
        .card a .badge {
            position: absolute;
            /* put badge at the visual right even in RTL (inline-start is right in RTL) */
            inset-inline-start: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: #b40000;
            color: #fff;
            padding: .12rem .45rem;
            border-radius: 6px;
            font-size: .72rem;
            font-weight: 700;
            z-index: 3;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }

        /* when a download is cancellable, show pointer to indicate action */
        .card a.can-cancel { cursor: pointer; }

        .card a .label {
            display: inline-block;
            text-align: center;
            /* reserve space on the right so centered text doesn't overlap the badge (RTL-aware) */
            padding-inline-start: 2.8rem;
            padding-inline-end: .4rem;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: calc(100% - 3.6rem);
        }

        .card a:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.06);
            background: #fafafa;
        }

        .card a:active {
            transform: translateY(0) scale(.997);
            box-shadow: 0 4px 8px rgba(0,0,0,0.03), inset 0 -3px 6px rgba(0,0,0,0.02);
        }

        .card a:focus-visible {
            outline: 3px solid rgba(180,0,0,0.12);
            outline-offset: 2px;
        }

        /* Progress fill (wave-like) */
        .card a::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: var(--progress);
            z-index: 0;
            background-image: linear-gradient(90deg, #3b82f6 0%, #60a5fa 60%),
                              radial-gradient(circle at 20% 50%, rgba(255,255,255,0.12), rgba(255,255,255,0) 40%);
            background-blend-mode: screen;
            transition: width .36s linear;
            box-shadow: inset 0 -6px 12px rgba(0,0,0,0.04);
        }

        /* subtle moving stripes to simulate a wave */
        .card a::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: var(--progress);
            z-index: 0;
            background-image: repeating-linear-gradient( -45deg, rgba(255,255,255,0.06) 0 6px, rgba(255,255,255,0.02) 6px 12px );
            opacity: .9;
            transform: translateX(0);
            transition: opacity .32s;
            pointer-events: none;
            animation: wave 3.4s linear infinite;
        }

        @keyframes wave {
            from { transform: translateX(0); }
            to { transform: translateX(-24px); }
        }

        .card a .label,
        .card a .percent {
            position: relative;
            z-index: 2;
        }

        .card a .percent {
            margin-left: .5rem;
            opacity: 0;
            transition: opacity .28s;
        }

        .card a.downloading .percent {
            opacity: 1;
        }

        .card a.downloading {
            cursor: progress;
        }

        /* ensure cancellable downloading buttons show pointer (override progress) */
        .card a.downloading.can-cancel {
            cursor: pointer;
        }

        /* XLSX badge: green to indicate spreadsheet */
        .card a .badge.xlsx {
            background: #16a34a;
            color: #fff;
        }

        /* compressor UI */
        .compress-ui { text-align: center; margin-top: .6rem; }
        .compress-controls { display: flex; gap: .6rem; justify-content: center; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
        .compress-controls input[type="number"] { width: 140px; padding: .45rem .6rem; border-radius: 10px; border: 1px solid #e6e6e6; background: #fff; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.02); font-size: .95rem; text-align: center; height: 40px; }
        #imageInput { display: none; }
        .file-label { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .8rem; background:#f6f7fb; border:1px solid #e6e6e6; border-radius:10px; cursor:pointer; color:#333; box-shadow: 0 2px 6px rgba(0,0,0,0.03); height:40px; }
        .file-label:hover { background:#fafafa; }
        .compress-note { margin-top: .5rem; color: #666; font-size: .82rem; }
        .selected-file { border: 1px dashed #d0d0d0; padding: .45rem .6rem; margin-top: .5rem; border-radius: 8px; min-height: 36px; display: inline-block; width: 100%; max-width: 100%; box-sizing: border-box; color: #333; background: #fff; }
        .selected-file .name { font-weight: 600; }
        .selected-file .size { color: #666; font-size: .85rem; margin-left: .6rem; }
        @media (max-width: 480px) {
            .compress-controls { gap: .4rem; }
            .compress-controls input[type="number"] { width: 100%; max-width: 220px; }
            .file-label, .selected-file { width: 100%; }
            #compressBtn { display: inline-block; width: 100%; }
        }

        /* ============ MOBILE FIX ============ */
        @media (max-width: 600px) {
            .hero-row {
                grid-template-areas:
                    "logo1 logo2"
                    "text  text";
                grid-template-columns: max-content;
                justify-content: center;
                row-gap: 1rem;
                text-align: center;
            }
        }