/* =====================================================================
   Sorenix — سیستم طراحی
   --------------------------------------------------------------------
   دست‌نویس و بدون بیلد. در پروژه‌های قبلی، بیلدِ دستیِ Tailwind باعث
   می‌شد کلاسی که در بیلد نیست بی‌صدا بی‌اثر بماند و ساعت‌ها وقت بگیرد.
   اینجا هر کلاسی که نوشته شده، همین‌جا تعریف هم شده.

   **دو قاعده که همه‌جا رعایت شده‌اند**

   ۱. هیچ `left`/`right`ای در کار نیست — فقط خواصِ منطقی
      (`padding-inline-start`, `margin-inline`, `inset-inline`). سایت
      انگلیسی (چپ‌به‌راست) و فارسی/عربی (راست‌به‌چپ) را با همین یک
      شیوه‌نامه سرو می‌کند؛ هیچ بلوکِ جداگانه‌ای برای RTL لازم نیست.

   ۲. واژگانِ کلاس‌ها همان است که ۱۰۱ صفحهٔ ابزار از قبل استفاده
      می‌کنند (`panel`, `row`, `field`, `btn`, `stat`…). ظاهرشان عوض
      شده، نامشان نه — پس همهٔ ابزارها بی‌آنکه دست بخورند، تازه شدند.
   ===================================================================== */

/* ------------------------------------------------------- توکن‌ها */
:root {
    color-scheme: light;

    --bg: #fbfbfd;
    --bg-soft: #f4f5f9;
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #eef0f6;

    --border: #e5e7ef;
    --border-strong: #d3d7e3;

    --text: #14161f;
    --text-2: #454b5e;
    --muted: #6d7488;
    --faint: #99a0b3;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef1ff;
    --accent-border: #d5daff;
    --on-accent: #ffffff;

    --success: #0f766e;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warn: #b45309;
    --warn-soft: #fffbeb;

    --r-xs: 6px;
    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-full: 999px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 4px 16px -4px rgba(16, 24, 40, .10);
    --shadow-lg: 0 18px 40px -16px rgba(16, 24, 40, .22);

    --max: 1120px;
    --head-h: 64px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --font-fa: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;

    --ease: cubic-bezier(.4, 0, .2, 1);

    /* ── سازگاری با نام‌های پیشین ──────────────────────────────────
       اجزای منتقل‌شده (پایین فایل) هنوز با نام‌های قدیمی صدا می‌زنند.
       به‌جای دست‌بردن در ده‌ها قاعده، همان‌ها را به توکن‌های تازه
       نگاشت می‌کنیم. */
    --primary: var(--accent);
    --primary-dark: var(--accent-hover);
    --primary-soft: var(--accent-soft);
    --radius: var(--r);
    --radius-sm: var(--r-sm);
}

:root[data-theme="dark"],
html:not([data-theme="light"]) {
    /* پیش‌فرضِ روشن بالا تعریف شد؛ تاریکی فقط توکن‌ها را عوض می‌کند. */
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --bg: #0c0e16;
        --bg-soft: #11141f;
        --surface: #151824;
        --surface-2: #1b1f2e;
        --surface-3: #232838;

        --border: #262c3d;
        --border-strong: #333a4f;

        --text: #eef0f7;
        --text-2: #bcc2d4;
        --muted: #9099ae;
        --faint: #6a7288;

        --accent: #7b78f5;
        --accent-hover: #8d8bf7;
        --accent-soft: #1d1f3a;
        --accent-border: #313463;

        --success: #2dd4bf;
        --success-soft: #10241f;
        --danger: #f87171;
        --danger-soft: #2a1416;
        --warn: #fbbf24;
        --warn-soft: #2a1f0d;

        --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
        --shadow: 0 4px 16px -4px rgba(0, 0, 0, .5);
        --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .65);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0c0e16;
    --bg-soft: #11141f;
    --surface: #151824;
    --surface-2: #1b1f2e;
    --surface-3: #232838;

    --border: #262c3d;
    --border-strong: #333a4f;

    --text: #eef0f7;
    --text-2: #bcc2d4;
    --muted: #9099ae;
    --faint: #6a7288;

    --accent: #7b78f5;
    --accent-hover: #8d8bf7;
    --accent-soft: #1d1f3a;
    --accent-border: #313463;

    --success: #2dd4bf;
    --success-soft: #10241f;
    --danger: #f87171;
    --danger-soft: #2a1416;
    --warn: #fbbf24;
    --warn-soft: #2a1f0d;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px -4px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .65);
}

/* -------------------------------------------------------- پایه */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html[dir="rtl"] body { font-family: var(--font-fa); line-height: 1.85; }

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -.02em;
    font-weight: 650;
}

p { margin: 0; }

a {
    color: inherit;
    text-decoration: none;
    transition: color .15s var(--ease);
}

img, svg { vertical-align: middle; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: 20px;
}

.skip {
    position: absolute;
    inset-inline-start: -9999px;
    top: 8px;
    background: var(--accent);
    color: var(--on-accent);
    padding: 10px 18px;
    border-radius: var(--r-sm);
    z-index: 200;
}

.skip:focus { inset-inline-start: 12px; }

.hide-sm { display: inline-flex; }

/* عددها و کدها همیشه چپ‌به‌راست، حتی وسط متن فارسی. */
.ltr, .mono-out, code, kbd, pre {
    direction: ltr;
    text-align: start;
    unicode-bidi: isolate;
}

/* -------------------------------------------------------- سربرگ */
.site-head {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.head-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--head-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 680;
    font-size: 16px;
    letter-spacing: -.02em;
    flex-shrink: 0;
}

.brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--accent), #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.brand__sub {
    display: block;
    font-size: 11px;
    font-weight: 450;
    color: var(--muted);
    letter-spacing: 0;
    line-height: 1.2;
    margin-top: 1px;
}

.head-search { flex: 1; display: flex; justify-content: center; }

.head-search__btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 380px;
    padding: 8px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}

.head-search__btn:hover {
    border-color: var(--border-strong);
    background: var(--surface);
}

.head-search__btn > span:first-of-type {
    flex: 1;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.head-search__kbd { display: flex; gap: 3px; }

kbd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.4;
}

.head-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.head-nav > a {
    padding: 7px 11px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
}

.head-nav > a:hover { background: var(--surface-2); color: var(--text); }

.icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s var(--ease);
}

.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }

.i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .i-moon { display: none; }
    :root:not([data-theme="light"]) .i-sun { display: block; }
}

/* انتخاب زبان */
.lang {
    position: relative;
}

.lang__btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.lang__btn:hover { background: var(--surface-2); border-color: var(--border); }

.lang__menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    padding: 5px;
    display: none;
    z-index: 60;
}

.lang.is-open .lang__menu { display: block; }

.lang__menu button {
    display: block;
    width: 100%;
    text-align: start;
    padding: 8px 11px;
    background: none;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.lang__menu button:hover { background: var(--surface-2); }
.lang__menu button[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------ صفحهٔ اصلی */
main { flex: 1; }

.hero {
    padding-block: clamp(48px, 9vw, 96px) clamp(32px, 5vw, 56px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* هالهٔ نرم پشت عنوان — با گرادیانِ محو، نه تصویر. */
.hero::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: -30%;
    height: 130%;
    background: radial-gradient(ellipse 60% 50% at 50% 0%,
                color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
    pointer-events: none;
}

.hero > * { position: relative; }

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 22px;
    box-shadow: var(--shadow-xs);
}

.hero__eyebrow b { color: var(--text); font-weight: 640; }

.hero h1 {
    font-size: clamp(32px, 5.4vw, 54px);
    line-height: 1.12;
    letter-spacing: -.035em;
    font-weight: 700;
    max-width: 16ch;
    margin-inline: auto;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lead {
    margin-top: 18px;
    font-size: clamp(15px, 1.7vw, 17.5px);
    color: var(--muted);
    max-width: 56ch;
    margin-inline: auto;
    line-height: 1.65;
}

.hero__search {
    margin-top: 32px;
    max-width: 560px;
    margin-inline: auto;
}

.bigsearch {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 5px 6px 5px 18px;
    padding-inline: 18px 6px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    box-shadow: var(--shadow);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

.bigsearch:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}

.bigsearch svg { color: var(--faint); flex-shrink: 0; }

.bigsearch input {
    flex: 1;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 15.5px;
    padding-block: 12px;
    min-width: 0;
}

.bigsearch input:focus { outline: none; }
.bigsearch input::placeholder { color: var(--faint); }

.hero__meta {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13px;
    color: var(--muted);
}

.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta svg { color: var(--success); }

/* دسته‌ها */
.cats {
    padding-block: clamp(20px, 4vw, 44px) clamp(48px, 8vw, 88px);
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.cat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease),
                border-color .18s var(--ease);
    position: relative;
    overflow: hidden;
}

.cat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--accent-border);
}

.cat__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.cat__title {
    font-size: 17px;
    font-weight: 640;
    letter-spacing: -.02em;
}

.cat__desc {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

.cat__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.cat__n { font-weight: 600; color: var(--text-2); }

.cat__go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-weight: 550;
}

/* فلش در راست‌به‌چپ باید برعکس شود. */
html[dir="rtl"] .cat__go svg,
html[dir="rtl"] .tool-card__go svg { transform: scaleX(-1); }

/* نوار اتوماسیون */
.band {
    padding-block: clamp(36px, 6vw, 64px);
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.band__box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.band__text { flex: 1; min-width: 260px; }

.band__text h2 {
    font-size: clamp(20px, 2.6vw, 26px);
    letter-spacing: -.025em;
}

.band__text p {
    margin-top: 9px;
    color: var(--muted);
    font-size: 14.5px;
    max-width: 60ch;
    line-height: 1.65;
}

/* ------------------------------------------------- کارت ابزار */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 12px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    height: 100%;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease),
                transform .15s var(--ease);
}

.tool-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.tool-card__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--accent);
    flex-shrink: 0;
    transition: background .15s var(--ease);
}

.tool-card:hover .tool-card__icon { background: var(--accent-soft); }

.tool-card__body { min-width: 0; flex: 1; }

.tool-card__title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 3px;
}

.tool-card__desc {
    font-size: 12.8px;
    color: var(--muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card__go { display: none; }

/* ------------------------------------------------ سرِ صفحه‌ها */
.page-head {
    padding-block: clamp(28px, 5vw, 48px) 22px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.page-head h1 {
    font-size: clamp(24px, 3.6vw, 34px);
    letter-spacing: -.03em;
}

.page-head p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
    max-width: 62ch;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.crumbs a:hover { color: var(--accent); }
.crumbs svg { opacity: .5; }
html[dir="rtl"] .crumbs svg { transform: scaleX(-1); }

.section { padding-block: clamp(28px, 5vw, 48px); }

.section__head {
    display: flex;
    align-items: baseline;
    gap: 11px;
    margin-bottom: 16px;
}

.section__head h2 {
    font-size: 19px;
    letter-spacing: -.02em;
}

.section__count {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.empty {
    padding: 56px 20px;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
}

.empty h3 { font-size: 17px; color: var(--text); margin-bottom: 7px; }

/* --------------------------------------------- چیدمان ابزار */
.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    padding-block: clamp(22px, 4vw, 36px);
}

@media (max-width: 900px) {
    .tool-layout { grid-template-columns: minmax(0, 1fr); }
}

.tool-head { margin-bottom: 20px; }

.tool-head h1 {
    font-size: clamp(22px, 3.2vw, 30px);
    letter-spacing: -.03em;
}

.tool-head p {
    margin-top: 9px;
    color: var(--muted);
    font-size: 14.5px;
    max-width: 62ch;
}

.side__box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px;
    margin-bottom: 14px;
}

.side__title {
    font-size: 13px;
    font-weight: 640;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}

/* --------------------------------------------------- پنل و فرم */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}

.panel__title {
    font-size: 16px;
    font-weight: 640;
    letter-spacing: -.02em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.panel--result {
    border-color: var(--accent-border);
    background: linear-gradient(180deg, var(--accent-soft), var(--surface) 90px);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.row:last-child { margin-bottom: 0; }
.row--end { justify-content: flex-end; align-items: center; }

.field {
    flex: 1;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.label {
    font-size: 13px;
    font-weight: 560;
    color: var(--text-2);
}

.input, .textarea, select.input {
    width: 100%;
    padding: 10px 13px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

.input:focus, .textarea:focus, select.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3.5px var(--accent-soft);
}

.input::placeholder, .textarea::placeholder { color: var(--faint); }

.textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.7;
}

.textarea--code {
    font-family: var(--font-mono);
    font-size: 13px;
    direction: ltr;
    text-align: start;
    line-height: 1.6;
}

.hint {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

.hint-inline { font-size: 12.5px; color: var(--muted); }

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

.check input[type="checkbox"], .check input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.rule {
    height: 1px;
    background: var(--border);
    border: 0;
    margin-block: 18px;
}

/* --------------------------------------------------------- دکمه */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 19px;
    background: var(--accent);
    color: var(--on-accent);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 14.5px;
    font-weight: 560;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s var(--ease), transform .1s var(--ease),
                box-shadow .15s var(--ease);
    box-shadow: var(--shadow-xs);
}

.btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }

.btn:disabled, .btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.btn--ghost {
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--border-strong);
    box-shadow: none;
}

.btn--ghost:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}

.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--lg { padding: 13px 26px; font-size: 15.5px; }
.btn--block { width: 100%; }

/* ------------------------------------------------ نشان و هشدار */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 550;
    border: 1px solid var(--border);
}

.badge--ok {
    background: var(--success-soft);
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 26%, transparent);
}

.alert {
    padding: 13px 16px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert svg { flex-shrink: 0; margin-top: 3px; }

.alert--warn {
    background: var(--warn-soft);
    border-color: color-mix(in srgb, var(--warn) 30%, transparent);
    color: var(--warn);
}

.alert--ok {
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
    color: var(--success);
}

.alert--danger {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
    color: var(--danger);
}

.errorlist {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--danger);
    font-size: 12.5px;
}

/* ---------------------------------------------------- آمار */
.statgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 11px;
}

.stat {
    padding: 15px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    text-align: center;
}

.stat--hi {
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

.stat__num {
    font-size: 21px;
    font-weight: 680;
    letter-spacing: -.02em;
    display: block;
    line-height: 1.3;
}

.stat--hi .stat__num { color: var(--accent); }

.stat__label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    display: block;
}

/* ---------------------------------------------- خروجی و جدول */
.mono-out {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 13px 15px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
    max-height: 460px;
    overflow: auto;
    margin: 0;
}

.tablewrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th, .table td {
    padding: 10px 13px;
    text-align: start;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-2);
    font-size: 12.5px;
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }

.cols { display: grid; gap: 14px; }
.cols--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.grid { display: grid; gap: 14px; }

.filelist__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    margin-bottom: 7px;
}

.swatches { display: flex; flex-wrap: wrap; gap: 9px; }

.swatch {
    width: 60px;
    height: 60px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    position: relative;
}

.diffrow__ln {
    color: var(--faint);
    font-family: var(--font-mono);
    font-size: 12px;
    user-select: none;
}

/* --------------------------------------------------- جای فایل */
.drop {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r);
    padding: 30px 20px;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}

.drop:hover, .drop.is-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ---------------------------------------------------- پانویس */
.site-foot {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding-block: 26px;
    margin-top: auto;
    font-size: 13.5px;
    color: var(--muted);
}

.foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--accent); }

/* ------------------------------------------------- پالت فرمان */
.palette {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    padding: clamp(40px, 12vh, 120px) 18px 18px;
    background: rgba(9, 11, 20, .5);
    backdrop-filter: blur(4px);
}

.palette.is-open { display: block; }

.palette__box {
    max-width: 620px;
    margin-inline: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.palette__head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.palette__head svg { color: var(--faint); flex-shrink: 0; }

.palette__input {
    flex: 1;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    min-width: 0;
}

.palette__input:focus { outline: none; }

.palette__list {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 7px;
}

.palette__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-radius: var(--r-sm);
    cursor: pointer;
}

.palette__item.is-active { background: var(--accent-soft); }

.palette__item svg { color: var(--accent); flex-shrink: 0; }

.palette__item-t { font-size: 14.5px; font-weight: 550; }

.palette__item-d {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette__cat {
    margin-inline-start: auto;
    font-size: 11.5px;
    color: var(--faint);
    white-space: nowrap;
    flex-shrink: 0;
}

.palette__empty { padding: 34px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------ موبایل */
@media (max-width: 720px) {
    .hide-sm { display: none !important; }
    .head-search { order: 3; flex-basis: 100%; }
    .site-head { position: static; }
    .head-row { height: auto; padding-block: 11px; flex-wrap: wrap; }
    .brand__sub { display: none; }
    .panel { padding: 17px; }
    .wrap { padding-inline: 16px; }
    .band__box { flex-direction: column; align-items: stretch; }
    .foot-row { flex-direction: column; text-align: center; }
}


/* =====================================================================
   اجزای منتقل‌شده از شیوه‌نامهٔ پیشین
   --------------------------------------------------------------------
   این‌ها دست‌نخورده‌اند و روی توکن‌های تازه سوارند (نگاشتِ نام‌ها در
   بخش «سازگاری» بالا). طرحِ تازه فقط اسکلت را عوض کرد؛ این اجزا
   کارشان درست بود و دلیلی برای بازنویسی‌شان نبود.
   ===================================================================== */
.hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.search {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

.search input {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 46px 0 18px;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    box-shadow: var(--shadow);
}

.search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.search__icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}

@media (min-width: 900px) {
.cols--side { grid-template-columns: 1fr 300px; align-items: start; }
}

.input, .textarea, .select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}

.textarea--code, .code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    direction: ltr;
    text-align: left;
    font-size: .84rem;
    line-height: 1.75;
}

.drop__icon { color: var(--primary); margin-bottom: 8px; }

.drop__title { font-weight: 800; font-size: .92rem; }

.drop__hint { color: var(--muted); font-size: .79rem; margin-top: 3px; }

.filelist {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filelist__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filelist__size { color: var(--muted); font-size: .76rem; }

.alert--error {
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 32%, var(--border));
    color: var(--danger);
}

.alert--info {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    color: var(--primary);
}

.result {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 460px;
    overflow: auto;
    font-size: .88rem;
    line-height: 1.9;
}

.result--big {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 2;
    text-align: center;
    white-space: normal;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.table-wrap { overflow-x: auto; }

.copy-wrap { position: relative; }

.copy-btn {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 2;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.bigresult {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 16px;
    text-align: center;
}

.bigresult__from,
.bigresult__unit { color: var(--muted); font-size: .92rem; }

.bigresult__eq { color: var(--muted); font-size: 1.2rem; }

.bigresult__to {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary);
    direction: ltr;
    unicode-bidi: isolate;
    word-break: break-all;
}

.tablewrap--tall { max-height: 460px; overflow-y: auto; }

.difflist {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: .84rem;
    max-height: 520px;
    overflow-y: auto;
}

.diffrow {
    display: grid;
    grid-template-columns: 44px 44px 20px 1fr;
    gap: 0;
    align-items: start;
    border-bottom: 1px solid var(--border);
}

.diffrow:last-child { border-bottom: 0; }

.diffrow__sign {
    padding: 5px 0;
    text-align: center;
    font-weight: 800;
    user-select: none;
}

.diffrow__text {
    padding: 5px 10px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    direction: auto;
}

.diffrow--add { background: rgba(13, 148, 136, .10); }

.diffrow--add .diffrow__sign { color: var(--success); }

.diffrow--del { background: rgba(220, 38, 38, .10); }

.diffrow--del .diffrow__sign { color: var(--danger); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip b {
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    font-size: .76rem;
}

.colorbar {
    border-radius: var(--radius-sm);
    padding: 34px 16px;
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: .06em;
    border: 1px solid var(--border);
    direction: ltr;
}

.cropstage { margin-top: 14px; }

.cropstage__box {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.cropstage__box img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.cropsel {
    position: absolute;
    border: 2px dashed #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .42);
    pointer-events: none;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}

.list {
    margin: 8px 0 0;
    padding-inline-start: 20px;
    font-size: .86rem;
    line-height: 2;
    color: var(--muted);
}

.list code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: .82em;
    direction: ltr;
    display: inline-block;
}

.badge--bad { border-color: var(--danger); color: var(--danger); }

@media (max-width: 560px) {
.bigresult__to { font-size: 1.5rem; }
.diffrow { grid-template-columns: 34px 34px 18px 1fr; }
}

.palette__t { font-weight: 600; font-size: .88rem; }

.palette__c { margin-inline-start: auto; font-size: .72rem; color: var(--muted); }

.hero h1 .grad {
    background: linear-gradient(90deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__badges { margin-top: 18px; }

.side {
    position: sticky;
    top: calc(var(--head-h) + 18px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side__link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: .82rem;
    transition: background .14s var(--ease);
}

.side__link:hover { background: var(--surface-2); }

.side__link.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.side__link svg { flex: 0 0 auto; opacity: .75; }

.side__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side__n { margin-inline-start: auto; font-size: .7rem; color: var(--muted); }

@media (max-width: 940px) {
.side { display: none; }
}

.fav {
    position: absolute;
    top: 9px;
    inset-inline-end: 9px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .16s var(--ease), color .16s var(--ease);
}

.fav:hover { background: var(--surface-2); color: var(--warn); }

.btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }

.btn.is-busy::after {
    content: "";
    width: 13px;
    height: 13px;
    margin-inline-start: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    vertical-align: -2px;
    animation: spin .7s linear infinite;
}

.preview {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.preview__item {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.preview__item img { width: 100%; height: 100%; object-fit: cover; }

.preview__item span {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: .6rem;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uprogress {
    height: 5px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
    display: none;
}

.uprogress.is-on { display: block; }

.uprogress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    transition: width .2s var(--ease);
}

.toasts {
    position: fixed;
    inset-block-end: 18px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: var(--text);
    color: var(--bg);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: .84rem;
    font-weight: 600;
    box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .5);
    animation: toastin .22s var(--ease);
}

.toast--bad { background: var(--danger); color: #fff; }

.counter {
    font-size: .72rem;
    color: var(--muted);
    text-align: end;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.footnote {
    text-align: center;
    color: var(--muted);
    font-size: .78rem;
    margin: 26px 0 0;
}

@media (max-width: 560px) {
.toasts { inset-inline: 16px; transform: none; }
}

.tool-card-wrap {
    position: relative;
    display: flex;
}

.tool-card-wrap > .tool-card {
    flex: 1;
    min-width: 0;
}

.tool-card-wrap:hover .fav,
.fav:focus,
.fav:focus-visible,
.fav[aria-pressed="true"] { opacity: 1; }

.fav[aria-pressed="true"] { color: var(--warn); }

.fav[aria-pressed="true"] svg { fill: currentColor; }

.sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


/* ------------------------------------------------------ صفحهٔ خطا */
.errpage {
    padding: clamp(56px, 12vh, 120px) 20px;
    text-align: center;
    max-width: 52ch;
    margin-inline: auto;
}

.errpage__code {
    font-size: clamp(56px, 12vw, 96px);
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1;
    color: var(--accent);
    opacity: .22;
}

.errpage h1 {
    font-size: clamp(22px, 3.4vw, 30px);
    margin-top: 6px;
    letter-spacing: -.03em;
}

.errpage p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 15px;
}

.errpage__acts {
    margin-top: 26px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
/* =====================================================================
   Sorenix — Redesign layer (v2)
   --------------------------------------------------------------------
   لایهٔ طراحیِ نو. عمداً در انتهای app.css می‌نشیند تا با بازتعریفِ
   توکن‌ها و بازطراحیِ پوسته، کلِ سایت — از جمله ۱۰۰+ ابزار — بدون
   دست‌خوردنِ نامِ کلاس‌ها، ظاهرِ تازه بگیرد.

   پالت از لوگوی سورنیکس گرفته شده: طلاییِ فیلم (#FFE708→#F5A800) روی
   زمینهٔ زغالی/گرافیتی، با نقره‌ایِ «STUDIO». حسِ لوکس، مطمئن، حرفه‌ای.
   همه‌چیز با خواصِ منطقی (inline-start/‌end) نوشته شده تا LTR و RTL با
   یک شیوه‌نامه سرو شوند.
   ===================================================================== */

/* --------------------------------------------------------- توکن‌ها */
:root {
    color-scheme: light;

    /* زمینه‌ها — عاجِ گرم، نه سفیدِ خام */
    --bg: #f7f5f0;
    --bg-soft: #efece4;
    --surface: #ffffff;
    --surface-2: #faf8f3;
    --surface-3: #f1eee6;

    --border: #e7e2d6;
    --border-strong: #d8d1c0;

    --text: #17181d;
    --text-2: #43454e;
    --muted: #6d6f7a;
    --faint: #9a9ba6;

    /* طلا — پرکنندهٔ دکمه/برجسته‌ها؛ برای متنِ لینک، کهرباییِ خواناتر */
    --gold: #ffc917;
    --gold-bright: #ffe708;
    --gold-deep: #e3931a;
    --gold-pale: #fcda7f;
    --ink: #17181d;

    --accent: #b07708;          /* متنِ کهربایی خوانا روی زمینهٔ روشن */
    --accent-hover: #8f6006;
    --accent-soft: #fdf4dc;
    --accent-border: #f2dfa5;
    --on-accent: #17181d;       /* متنِ روی پرکنندهٔ طلایی: زغالی */

    --success: #0f766e;
    --success-soft: #ecfdf5;
    --danger: #c62f2f;
    --danger-soft: #fdf2f2;
    --warn: #a86a00;
    --warn-soft: #fdf6e7;

    --r-xs: 8px;
    --r-sm: 12px;
    --r: 16px;
    --r-lg: 24px;
    --r-full: 999px;

    --shadow-xs: 0 1px 2px rgba(23, 24, 29, .05);
    --shadow-sm: 0 2px 8px -2px rgba(23, 24, 29, .08);
    --shadow: 0 10px 30px -12px rgba(23, 24, 29, .18);
    --shadow-lg: 0 30px 60px -24px rgba(23, 24, 29, .28);
    --glow-gold: 0 8px 30px -8px rgba(227, 147, 26, .45);

    --max: 1200px;
    --head-h: 74px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --font-display: "Sora", var(--font);
    --font-fa: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;

    --ease: cubic-bezier(.4, 0, .2, 1);

    --primary: var(--accent);
    --primary-dark: var(--accent-hover);
    --primary-soft: var(--accent-soft);
    --radius: var(--r);
    --radius-sm: var(--r-sm);
}

/* زبان‌محور: خانوادهٔ فونت با زبانِ صفحه عوض می‌شود */
html[lang="fa"] { --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
                  --font-display: "Vazirmatn", sans-serif; }
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
                  --font-display: "IBM Plex Sans Arabic", sans-serif; }

/* تاریکی — زغالیِ عمیق با طلا؛ حسِ اصلیِ لوکس اینجاست */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0d0e12;
        --bg-soft: #101218;
        --surface: #16181f;
        --surface-2: #1c1f28;
        --surface-3: #242833;
        --border: #2a2e3a;
        --border-strong: #3a3f4e;
        --text: #f4f5f8;
        --text-2: #c4c7d2;
        --muted: #949aa8;
        --faint: #6b7180;
        --accent: #ffcb2e;
        --accent-hover: #ffd75a;
        --accent-soft: #241d0c;
        --accent-border: #4a3a12;
        --on-accent: #17181d;
        --success: #34d3bf;
        --danger: #f87171;
        --warn: #fbbf24;
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, .5);
        --shadow: 0 16px 40px -14px rgba(0, 0, 0, .6);
        --shadow-lg: 0 34px 70px -22px rgba(0, 0, 0, .72);
        --glow-gold: 0 10px 40px -8px rgba(255, 201, 23, .3);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d0e12;
    --bg-soft: #101218;
    --surface: #16181f;
    --surface-2: #1c1f28;
    --surface-3: #242833;
    --border: #2a2e3a;
    --border-strong: #3a3f4e;
    --text: #f4f5f8;
    --text-2: #c4c7d2;
    --muted: #949aa8;
    --faint: #6b7180;
    --accent: #ffcb2e;
    --accent-hover: #ffd75a;
    --accent-soft: #241d0c;
    --accent-border: #4a3a12;
    --on-accent: #17181d;
    --success: #34d3bf;
    --danger: #f87171;
    --warn: #fbbf24;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, .5);
    --shadow: 0 16px 40px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 34px 70px -22px rgba(0, 0, 0, .72);
    --glow-gold: 0 10px 40px -8px rgba(255, 201, 23, .3);
}

/* --------------------------------------------------------- پایه */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, .brand__word { font-family: var(--font-display); letter-spacing: -.01em; }
.wrap { max-width: var(--max); }
::selection { background: var(--gold); color: var(--ink); }

/* ------------------------------------------------------- هدر/برند */
.site-head {
    height: var(--head-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.2) blur(14px);
    -webkit-backdrop-filter: saturate(1.2) blur(14px);
    border-bottom: 1px solid var(--border);
}
.head-row { height: var(--head-h); gap: 22px; }
.brand { gap: 10px; }
.brand__logo { height: 34px; width: auto; display: block; }
.brand__mark, .brand__sub { display: none; }   /* دیگر لوگوی متنی نداریم */

.head-nav { gap: 6px; align-items: center; }
.head-nav > a {
    padding: 9px 14px; border-radius: var(--r-full);
    color: var(--text-2); font-weight: 500; font-size: .95rem;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.head-nav > a:hover { color: var(--text); background: var(--surface-3); }
.head-nav > a.is-cta {
    color: var(--ink); background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    font-weight: 650; box-shadow: var(--shadow-sm);
}
.head-nav > a.is-cta:hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }

/* --------------------------------------------------------- دکمه‌ها */
.btn {
    font-family: var(--font); font-weight: 600;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--ink); border: 1px solid rgba(0,0,0,.06);
    border-radius: var(--r-full); box-shadow: var(--shadow-sm);
    transition: transform .12s var(--ease), box-shadow .2s var(--ease), filter .15s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--glow-gold); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 15px 28px; font-size: 1.02rem; }
.btn--ghost {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-strong); box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-3); box-shadow: none; filter: none; border-color: var(--gold-deep); }
.btn--quiet {
    background: var(--surface); color: var(--text-2);
    border: 1px solid var(--border); box-shadow: none;
}

/* --------------------------------------------------------- بخش‌ها */
.section-lead { text-align: center; max-width: 640px; margin-inline: auto; margin-bottom: 44px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font); font-weight: 650; font-size: .78rem;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent);
    padding: 6px 13px; border-radius: var(--r-full);
    background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.section-lead h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 16px 0 12px; }
.section-lead p { color: var(--muted); font-size: 1.06rem; line-height: 1.7; }

/* --------------------------------------------------------- هیرو */
.hero {
    position: relative; overflow: hidden;
    padding: clamp(64px, 11vw, 128px) 0 clamp(56px, 8vw, 96px);
    background:
        radial-gradient(1100px 460px at 50% -8%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
        var(--bg);
}
.hero::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.hero .wrap { position: relative; text-align: center; }
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 15px; border-radius: var(--r-full);
    background: var(--surface); border: 1px solid var(--border-strong);
    color: var(--text-2); font-size: .9rem; font-weight: 500;
    box-shadow: var(--shadow-xs);
}
.hero__eyebrow b { color: var(--accent); }
.hero h1 {
    font-size: clamp(2.4rem, 6.2vw, 4.6rem); line-height: 1.04;
    margin: 26px auto 0; max-width: 15ch; font-weight: 700;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--gold-deep), var(--gold), var(--gold-bright));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead {
    color: var(--text-2); font-size: clamp(1.05rem, 2vw, 1.28rem);
    line-height: 1.7; max-width: 62ch; margin: 22px auto 0;
}
.hero__actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__meta { margin-top: 30px; gap: 24px; justify-content: center; color: var(--muted); flex-wrap: wrap; }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta svg { color: var(--gold-deep); }

/* --------------------------------------------------- دو خدمت اصلی */
.offer-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 24px; margin: 8px 0;
}
.offer {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    padding: 34px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.offer:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold-pale); }
.offer__ico {
    inline-size: 54px; block-size: 54px; border-radius: 15px;
    display: grid; place-items: center; margin-bottom: 20px;
    background: linear-gradient(160deg, var(--gold-bright), var(--gold-deep));
    color: var(--ink); box-shadow: var(--glow-gold);
}
.offer h3 { font-size: 1.5rem; margin: 0 0 10px; }
.offer p { color: var(--muted); line-height: 1.7; margin: 0 0 22px; flex: 1; }
.offer__price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.offer__price b { font-family: var(--font-display); font-size: 2.4rem; color: var(--text); }
.offer__price span { color: var(--muted); font-size: .98rem; }
.offer__cta { margin-top: auto; }

/* لیست ویژگی‌ها */
.ticks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 11px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); line-height: 1.5; }
.ticks li::before {
    content: ""; flex-shrink: 0; margin-top: 3px;
    inline-size: 18px; block-size: 18px; border-radius: var(--r-full);
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(160deg, var(--gold-bright), var(--gold-deep)) border-box;
    border: 2px solid transparent;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23b07708' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
    background-color: var(--accent-soft);
}

/* --------------------------------------------------------- قیمت‌گذاری */
.plan {
    max-width: 460px; margin-inline: auto;
    padding: 40px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.plan::before {
    content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--gold-deep));
}
.plan__name { font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); font-size: .85rem; }
.plan__price { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; }
.plan__price b { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; }
.plan__price span { color: var(--muted); }
.plan__note { color: var(--muted); margin-bottom: 26px; }
.plan .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* --------------------------------------------------------- نمونه‌کار */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--r-lg); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.work:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.work__cover { aspect-ratio: 16 / 10; background: var(--surface-3); object-fit: cover; width: 100%; display: block; }
.work__cover--ph {
    display: grid; place-items: center;
    background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--gold) 30%, transparent), var(--surface-3));
    color: var(--gold-deep);
}
.work__body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work__tag { font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.work__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 650; }
.work__desc { color: var(--muted); line-height: 1.65; font-size: .96rem; flex: 1; }
.work__link { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: .95rem; }

/* --------------------------------------------------------- نوار CTA */
.band { padding: clamp(48px, 8vw, 88px) 0; }
.band__box {
    position: relative; overflow: hidden;
    border-radius: var(--r-lg); padding: clamp(32px, 5vw, 56px);
    background:
        radial-gradient(700px 300px at 85% -20%, color-mix(in srgb, var(--gold) 40%, transparent), transparent 60%),
        #14151a;
    color: #fff; border: 1px solid #24252c;
    display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.band__box h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 10px; }
.band__box p { color: rgba(255,255,255,.72); line-height: 1.7; max-width: 60ch; margin: 0; }

/* --------------------------------------------------------- فرم اتوماسیون */
.lead-card {
    max-width: 720px; margin-inline: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow);
    padding: clamp(26px, 4vw, 44px);
}
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lead-grid .field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; color: var(--text); margin-bottom: 7px; display: block; }
.input, .field input, .field textarea, .field select {
    width: 100%; padding: 13px 15px; border-radius: var(--r-sm);
    border: 1px solid var(--border-strong); background: var(--surface-2);
    color: var(--text); font-family: var(--font); font-size: 1rem;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus, .input:focus {
    outline: none; border-color: var(--gold-deep);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.field .hint { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.field .err { color: var(--danger); font-size: .9rem; margin-top: 6px; }

/* --------------------------------------------------------- فوتر + زبان */
.site-foot {
    margin-top: 96px; border-top: 1px solid var(--border);
    background: var(--surface-2);
    padding: 54px 0 40px;
}
.foot-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
    align-items: start;
}
.foot-brand__logo { height: 34px; margin-bottom: 16px; }
.foot-brand p { color: var(--muted); line-height: 1.7; max-width: 34ch; }
.foot-col h4 { font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; font-family: var(--font); }
.foot-col a { display: block; color: var(--text-2); padding: 5px 0; transition: color .15s var(--ease); }
.foot-col a:hover { color: var(--accent); }
.foot-bottom {
    margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.foot-bottom__copy { color: var(--muted); font-size: .92rem; }

/* کلید زبان در فوتر */
.lang-switch { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lang-switch__label { color: var(--faint); font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }
.lang-switch form { display: inline; }
.lang-switch button {
    font-family: var(--font); cursor: pointer;
    padding: 7px 14px; border-radius: var(--r-full);
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text-2); font-size: .9rem; font-weight: 500;
    transition: all .15s var(--ease);
}
.lang-switch button:hover { border-color: var(--gold-deep); color: var(--text); }
.lang-switch button[aria-current="true"] {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--ink); border-color: transparent; font-weight: 650;
}

/* --------------------------------------------------------- ریزه‌کاری‌ها */
.panel { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.tool-card, .cat, .side__box { border-radius: var(--r); }
.cat:hover { border-color: var(--gold-pale); box-shadow: var(--shadow); }
.cat__icon { color: var(--gold-deep); background: var(--accent-soft); border-color: var(--accent-border); }
.tool-card__icon { color: var(--gold-deep); }
.side__link.is-on { color: var(--accent); background: var(--accent-soft); }
a { color: var(--accent); }

/* --------------------------------------------------------- واکنش‌گرا */
@media (max-width: 860px) {
    .offer-grid, .lead-grid { grid-template-columns: 1fr; }
    .work-grid { grid-template-columns: 1fr 1fr; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
    .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .work-grid, .foot-grid { grid-template-columns: 1fr; }
    .band__box { flex-direction: column; align-items: flex-start; }
    .hero__actions { flex-direction: column; }
    .hero__actions .btn { width: 100%; justify-content: center; }
}
