        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        :root {
            --bg: #f5f7fa;
            --text: #2c3e50;
            --box-bg: #ffffff;
            --box-border: #e4e4e4;
            --sidebar-settings-width: 280px;
            --sidebar-icons-width: 90px;
            --sidebar-gap: 15px;
            --sidebar-radius: 12px;
        }

        body.dark {
            --bg: #1f1f22;
            --text: #f1f1f1;
            --box-bg: #26272a;
            --box-border: #3a3a3c;
        }

        body {
            margin: 0;
            padding: 0;
            background: var(--bg);
            color: var(--text);
            font-family: 'IRAN Yekan', 'IranYekan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            transition: background-color 0.3s, color 0.3s;
            background-image: radial-gradient(circle, rgba(44, 62, 80, 0.12) 1px, transparent 1px);
            background-size: 20px 20px;
        }

        body.dark {
            background-image: radial-gradient(circle, rgba(241, 241, 241, 0.08) 1px, transparent 1px);
        }

        .app-container {
            display: flex;
            min-height: 100vh;
            max-width: 100%;
            margin: 0 auto;
            position: relative;
        }

        .main-wrapper {
            flex: 1;
            margin-right: calc(var(--sidebar-settings-width) + var(--sidebar-icons-width) + var(--sidebar-gap) * 3);
            padding: 0 20px;
            width: 100%;
            min-width: 0;
        }

        .right-sidebar-settings {
            width: var(--sidebar-settings-width);
            background: var(--box-bg);
            border: 1px solid var(--box-border);
            border-radius: var(--sidebar-radius);
            position: fixed;
            right: calc(var(--sidebar-icons-width) + var(--sidebar-gap) * 2);
            top: var(--sidebar-gap);
            height: calc(100vh - var(--sidebar-gap) * 2);
            overflow-y: auto;
            z-index: 1000;
            display: flex;
            flex-direction: column;
        }

        .settings-header {
            padding: 24px 20px;
            border-bottom: 1px solid var(--box-border);
            text-align: center;
        }

        .settings-header h3 {
            margin: 0;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .settings-content {
            padding: 20px;
            flex: 1;
        }

        .setting-item {
            margin-bottom: 24px;
        }

        .setting-item label {
            font-size: 12px;
            display: block;
            margin-bottom: 8px;
            opacity: 0.8;
        }

        .setting-item select,
        .setting-item input[type="range"] {
            width: 100%;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid var(--box-border);
            background: var(--bg);
            color: var(--text);
            font-size: 13px;
        }

        .checkbox-side {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        .checkbox-side input {
            cursor: pointer;
            width: 16px;
            height: 16px;
        }

        .sidebar-download-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 12px;
            background: #10b981;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 20px;
        }

        .sidebar-download-btn:hover {
            background: #059669;
            transform: scale(1.02);
        }

        .sidebar-download-btn svg {
            width: 16px;
            height: 16px;
            stroke: white;
        }

        .right-sidebar-icons {
            width: var(--sidebar-icons-width);
            background: var(--box-bg);
            border: 1px solid var(--box-border);
            border-radius: var(--sidebar-radius);
            position: fixed;
            right: var(--sidebar-gap);
            top: var(--sidebar-gap);
            height: calc(100vh - var(--sidebar-gap) * 2);
            overflow-y: auto;
            z-index: 1000;
            display: flex;
            flex-direction: column;
        }

        .sidebar-icons-header {
            padding: 20px 0;
            text-align: center;
            border-bottom: 1px solid var(--box-border);
        }

        .sidebar-icons-nav {
            flex: 1;
            padding: 20px 0;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .icon-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 12px 5px;
            color: var(--text);
            text-decoration: none;
            transition: all 0.3s;
            cursor: pointer;
            text-align: center;
            font-size: 10px;
            border-right: 3px solid transparent;
        }

        .icon-nav-item:hover {
            background: var(--bg);
            border-right-color: #4f46e5;
        }

        .icon-nav-item.active {
            background: var(--bg);
            border-right-color: #4f46e5;
        }

        .icon-nav-item svg {
            width: 24px;
            height: 24px;
            stroke: currentColor;
            fill: none;
        }

        header {
            background: var(--box-bg);
            border: 1px solid var(--box-border);
            padding: 15px;
            margin-top: 16px;
            border-radius: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background-color 0.3s, border-color 0.3s;
        }

        .title {
            font-size: 20px;
            font-weight: bold;
            display: flex;
            align-items: baseline;
            gap: 12px;
            flex-wrap: wrap;
        }

        .title2 {
            font-size: 10px;
            background: #f4f5f6;
            border-radius: 15px;
            padding: 7px;
            text-align: center;
        }

        body.dark .title2 {
            background: #3a3a3c;
        }

        .header-right {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
        }

        .theme-buttons {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }

        .theme-buttons button {
            display: inline-flex;
            padding: 6px 10px;
            border-radius: 6px;
            border: 1px solid var(--box-border);
            background: var(--box-bg);
            color: var(--text);
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }

        .theme-buttons button:hover {
            background: #4f46e5;
            color: white;
        }

        .converter-card {
            background: var(--box-bg);
            border: 1px solid var(--box-border);
            border-radius: 12px;
            padding: 24px;
            margin-top: 20px;
            margin-bottom: 20px;
            transition: all 0.3s;
        }

        .converter-title {
            text-align: center;
            margin-bottom: 24px;
        }

        .converter-title h2 {
            margin-bottom: 8px;
            color: var(--text);
            font-size: 24px;
        }

        .converter-title p {
            color: var(--text);
            opacity: 0.7;
            font-size: 13px;
        }

        .upload-area {
            border: 2px dashed var(--box-border);
            border-radius: 12px;
            padding: 45px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: var(--bg);
        }

        .upload-area:hover {
            border-color: #4f46e5;
            background: var(--box-bg);
        }

        .upload-area.drag-over {
            border-color: #4f46e5;
            background: rgba(79, 70, 229, 0.1);
        }

        .upload-area svg {
            margin-bottom: 12px;
        }

        .upload-text {
            font-size: 14px;
            margin-bottom: 6px;
        }

        .upload-small {
            font-size: 11px;
            opacity: 0.6;
        }

        .preview-area {
            display: flex;
            gap: 24px;
            margin-top: 24px;
            flex-wrap: wrap;
        }

        .preview-box {
            flex: 1;
            text-align: center;
        }

        .preview-box h3 {
            margin-bottom: 12px;
            font-size: 14px;
            font-weight: 600;
        }

        .preview-box img {
            max-width: 100%;
            max-height: 250px;
            border-radius: 12px;
            border: 1px solid var(--box-border);
            background: var(--bg);
        }

        .sidebar-reset-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 11px;
            background: transparent;
            color: var(--text);
            border: 1px solid var(--box-border);
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 10px;
        }

        .sidebar-reset-btn:hover {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .sidebar-reset-btn svg {
            width: 15px;
            height: 15px;
        }

        .rotate-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 8px;
            border: 1px solid var(--box-border);
            border-radius: 6px;
            background: var(--bg);
            color: var(--text);
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .rotate-btn:hover {
            background: #4f46e5;
            color: white;
            border-color: #4f46e5;
        }

        .acc-section {
            border: 1px solid var(--box-border);
            border-radius: 8px;
            margin-bottom: 8px;
            overflow: hidden;
        }

        .acc-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            cursor: pointer;
            user-select: none;
            background: var(--bg);
            transition: background 0.2s;
        }

        .acc-header:hover { background: var(--box-border); }

        .acc-title {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 600;
        }

        .acc-arrow {
            transition: transform 0.2s;
            opacity: 0.5;
        }

        .acc-body {
            display: none;
            padding: 10px 12px;
            border-top: 1px solid var(--box-border);
        }

        .acc-body.open { display: block; }

        .acc-header.active .acc-arrow { transform: rotate(180deg); }

        .compact-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 8px;
        }

        .compact-row label {
            font-size: 11px;
            opacity: 0.75;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .compact-row select,
        .compact-row input[type="range"] {
            flex: 1;
            padding: 4px 6px;
            border-radius: 5px;
            border: 1px solid var(--box-border);
            background: var(--bg);
            color: var(--text);
            font-size: 11px;
            min-width: 0;
        }

        .compact-check {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            margin-bottom: 4px;
        }

        .compact-check input { cursor: pointer; width: 13px; height: 13px; }
        .compact-check label { cursor: pointer; opacity: 0.8; }

        .compact-input {
            width: 100%;
            padding: 5px 7px;
            border-radius: 5px;
            border: 1px solid var(--box-border);
            background: var(--bg);
            color: var(--text);
            font-size: 12px;
        }

        .settings-content { padding: 12px; flex: 1; }

        .image-info {
            margin-top: 10px;
            font-size: 11px;
            opacity: 0.7;
        }

        .svg-color-info {
            margin-top: 8px;
            padding: 6px 10px;
            background: rgba(79, 70, 229, 0.1);
            border-radius: 6px;
            font-size: 10px;
            display: inline-block;
            font-family: monospace;
        }

        footer {
            margin-top: 40px;
            padding: 20px;
            text-align: center;
            border-top: 1px solid var(--box-border);
            font-size: 12px;
        }

        .upload-area.hide-upload {
            display: none;
        }

        @media (max-width: 900px) {
            :root {
                --sidebar-settings-width: 260px;
                --sidebar-icons-width: 80px;
            }
            .main-wrapper {
                margin-right: calc(260px + 80px + var(--sidebar-gap) * 3);
            }
        }

        @media (max-width: 768px) {
            .right-sidebar-settings,
            .right-sidebar-icons {
                display: none;
            }
            .main-wrapper {
                margin-right: 0;
            }
            header {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }
            .title {
                font-size: 18px;
                text-align: center;
                justify-content: center;
            }
            .header-right {
                width: 100%;
                justify-content: center;
            }
            .preview-area {
                flex-direction: column;
            }
        }

        @media (max-width: 480px) {
            .title { font-size: 16px; }
            .converter-title h2 { font-size: 20px; }
        }



        .menu-item {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            color: inherit;

            width: 100%;
            padding: 6px 20px 6px 0; /* 20px فاصله از راست */
        
            cursor: pointer;
            background: none;
            transition: 0.25s;
        }
        
        /* حرکت نرم هنگام هاور */
        .menu-item:hover {
            transform: translateX(-4px);
        }
        
        /* رنگ هوشمند سازگار با تم */
        .menu-text,
        .menu-icon {
            color: #7a69ff;
            transition: 0.2s;
        }
        
        /* سایز آیکون */
        .menu-icon {
            font-size: 22px;
        }
        
        /* ===== تنظیم رنگ برای تم‌ها ===== */
    
        
        /* اگر سیستم کاربر دارک مود باشد */
        @media (prefers-color-scheme: dark) {
            :root {
                --menu-color: #e4ecff; /* آبی روشن برای تم تیره */
            }
        }
        




















        .mac-card {
            display: block;
            width: 350px;
            border-radius: 12px;
            background: var(--box-bg);
            border: 1px solid var(--box-border);
            overflow: hidden;
            text-decoration: none;
            color: #1f2937;
            margin-top: 20px; /* فاصله از بالا */
        }
        
        /* هدر مک */
        .mac-header {
            padding: 12px;
            background: #f9fafb;
            display: flex;
            gap: 6px;
            border-bottom: 1px solid #e5e7eb;
        }
        
        .dot { width: 10px; height: 10px; border-radius: 50%; }
        .red { background: #ff5f56; }
        .yellow { background: #ffbd2e; }
        .green { background: #27c93f; }
        
        /* تصویر */
        .mac-body {
            display: flex;
            justify-content: center;
        }
        
        .mac-body img {
            width: 100%;
            display: block;
        }
        
        /* متن‌ها */
        .mac-footer {
            padding: 20px;
            text-align: center; /* وسط چین شدن متن */
            color: #4f46e5;
        }
        .cart-title2{
            font-size: 12px;
        }
        
        .mac-footer h3 {
            margin: 0 0 8px 0;
            font-size: 18px;
            font-weight: 600;
        }
        
        .mac-footer p {
            margin: 0;
            font-size: 14px;
            color: #0055ff;
            line-height: 1.5;
        }
        @media (prefers-color-scheme: dark) {
            :root {
                --mac-footer: #e4ecff; /* آبی روشن برای تم تیره */
            }
        }




        .section-container {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
        }
        
        .section-container > * {
            flex: 1 1 250px;
        }