/* ==========================================================================
   MajorPDF – site stylesheet (no framework, no build step)
   ========================================================================== */

:root {
    --ink: #17181c;
    --ink-2: #3d414b;
    --muted: #6b7180;
    --line: #e4e6eb;
    --line-2: #d3d7de;
    --bg: #ffffff;
    --bg-soft: #f4f5f7;
    --bg-warm: #fbf7f4;
    --brand: #e5452f;
    --brand-dark: #c8361f;
    --brand-soft: #fdebe7;
    --ok: #1d8348;
    --ok-soft: #e7f5ec;
    --err: #c92a2a;
    --err-soft: #fdecec;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(23, 24, 28, .06);
    --shadow: 0 1px 2px rgba(23, 24, 28, .05), 0 4px 14px rgba(23, 24, 28, .06);
    --shadow-lg: 0 2px 6px rgba(23, 24, 28, .06), 0 18px 40px rgba(23, 24, 28, .10);
    --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --header-h: 64px;
    color-scheme: light;
}

:root[dir="rtl"] {
    --font: "IBM Plex Sans Arabic", "Figtree", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
:root[dir="rtl"] h1, :root[dir="rtl"] h2, :root[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
ul, ol { margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.container--narrow { max-width: 800px; }

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

.skip-link {
    position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100;
    background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { top: 10px; }

[dir="rtl"] .flip-rtl, [dir="rtl"] .arrow { transform: scaleX(-1); display: inline-block; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px; border-radius: 8px;
    border: 1px solid transparent; background: none;
    font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
    user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .08), inset 0 -1px 0 rgba(0, 0, 0, .12); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { border-color: var(--line-2); background: #fff; color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink-2); color: var(--ink); }
.btn--link { color: var(--muted); font-weight: 500; }
.btn--link:hover { color: var(--ink); text-decoration: underline; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { min-height: 50px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.btn--xl { min-height: 64px; padding: 0 34px; font-size: 19px; border-radius: 12px; }
.btn--xl svg { width: 22px; height: 22px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------- header */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; flex: none; }
.brand svg { flex: none; }
.brand--light { color: #fff; }
.brand__accent { color: var(--brand); }
.brand--light .brand__accent { color: #ff7a63; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav__item { position: relative; }
.nav__link {
    display: inline-flex; align-items: center; gap: 4px;
    height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: none;
    font-weight: 600; font-size: 15px; color: var(--ink-2); white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-expanded="true"], .nav__link[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }
.nav__link .chev { width: 12px; height: 12px; transition: transform .15s; }
.nav__link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.mega {
    position: absolute; top: calc(100% + 10px); inset-inline-start: -12px;
    width: min(980px, calc(100vw - 40px));
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 22px 22px 14px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility 0s .15s;
}
.mega::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.nav__item--menu.is-open .mega { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s; }
.mega--image { width: min(760px, calc(100vw - 40px)); }

.mega__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 20px; }
.mega--image .mega__grid { grid-template-columns: 1fr 2fr; }
.mega__col--wide ul { columns: 2; column-gap: 20px; }
.mega__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
:root[dir="rtl"] .mega__title { letter-spacing: 0; font-size: 13px; }
.mega ul { list-style: none; }
.mega li { break-inside: avoid; }
.mega li a {
    display: flex; align-items: center; gap: 9px; padding: 5px 6px; margin-inline: -6px;
    border-radius: 7px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
}
.mega li a:hover, .mega li a[aria-current="page"] { background: var(--bg-soft); color: var(--ink); }
.mega__all {
    display: inline-flex; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
    width: 100%; font-weight: 600; font-size: 14.5px; color: var(--brand);
}
.mega__all:hover { color: var(--brand-dark); }

.site-header__end { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.lang { position: relative; }
.lang summary {
    list-style: none; display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 17px; height: 17px; }
.lang summary:hover { border-color: var(--line-2); color: var(--ink); }
.lang ul {
    position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 160px;
    list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.lang li a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 14.5px; }
.lang li a:hover { background: var(--bg-soft); }
.lang li a[aria-current="true"] { font-weight: 700; color: var(--brand); }

.nav-toggle {
    display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------------------------------------------------------- icons */

.file-icon { position: relative; display: block; width: 100%; aspect-ratio: 40 / 48; color: var(--c); container-type: inline-size; }
.file-icon svg { width: 100%; height: 100%; overflow: visible; }
.file-icon b {
    position: absolute; inset-inline-start: 0; left: 0; top: 52.1%; width: 82.5%; height: 28.1%;
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22cqw; line-height: 1;
    letter-spacing: .01em; font-family: "Figtree", Arial, sans-serif; white-space: nowrap;
}
.file-icon--long b { font-size: 17cqw; }

.tool-icon { position: relative; display: inline-block; flex: none; }
.tool-icon--md { width: 54px; height: 54px; }
.tool-icon--lg { width: 72px; height: 72px; }
.tool-icon--sm { width: 22px; height: 22px; }

.tool-icon--convert .tool-icon__from,
.tool-icon--convert .tool-icon__to { position: absolute; width: 64%; }
.tool-icon--convert .tool-icon__from { inset-inline-start: 0; top: 0; opacity: .9; }
.tool-icon--convert .tool-icon__to { inset-inline-end: 0; bottom: -4%; filter: drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff); }
[dir="rtl"] .tool-icon--convert .tool-icon__to { filter: drop-shadow(2px 0 0 #fff) drop-shadow(0 -2px 0 #fff); }
.tool-icon--single .file-icon { width: 80%; margin-inline: auto; }

.tool-icon--action {
    display: inline-grid; place-items: center; border-radius: 11px;
    background: var(--c); color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.tool-icon--action svg { width: 56%; height: 56%; }
.tool-icon--action.tool-icon--sm { border-radius: 6px; }
.tool-icon--action.tool-icon--sm svg { width: 70%; height: 70%; stroke-width: 2.2; }
.tool-icon--action.tool-icon--lg { border-radius: 16px; }

/* ---------------------------------------------------------------- hero (home) */

.hero { padding: 64px 0 28px; text-align: center; }
.hero__title { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.025em; max-width: 860px; margin-inline: auto; }
.hero__lead { margin: 14px auto 0; max-width: 640px; font-size: clamp(16px, 1.8vw, 19px); color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 30px; }
.filters__btn {
    height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
    font-size: 14.5px; font-weight: 600; color: var(--ink-2);
    transition: background-color .15s, color .15s, border-color .15s;
}
.filters__btn:hover { border-color: var(--ink-2); color: var(--ink); }
.filters__btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- tool cards */

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tool-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    padding: 20px 20px 22px; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card .tool-icon { margin-bottom: 4px; }
.tool-card__name { font-size: 17px; font-weight: 700; color: var(--ink); }
.tool-card__desc { font-size: 14.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card[hidden] { display: none; }

.tools-section { padding-bottom: 56px; }

/* ---------------------------------------------------------------- image pairs */

.pairs { padding: 8px 20px 64px; }
.section-head { margin-bottom: 22px; }
.section-head h2, .section-title { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; }
.section-head p { margin-top: 6px; color: var(--muted); max-width: 680px; }
.section-head--center { text-align: center; }
.section-head--center p { margin-inline: auto; }
.section-title { margin-bottom: 22px; }

.pair-list { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pair {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.pair:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.pair__fmt {
    min-width: 46px; padding: 3px 7px; border-radius: 5px; text-align: center;
    font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--c);
}
.pair__arrow { width: 16px; height: 16px; color: var(--muted); }
[dir="rtl"] .pair__arrow { transform: scaleX(-1); }

/* ---------------------------------------------------------------- size bar (compress to 100KB…) */

.size-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 18px; }
.size-links__label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.size-links__list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.size-chip {
    display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px;
    border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 14px; font-weight: 600;
    font-variant-numeric: tabular-nums; transition: border-color .15s, color .15s, background .15s;
}
.size-chip:hover { border-color: var(--brand); color: var(--brand); }
.size-chip[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.size-chip--custom { border-style: dashed; }
.size-links-group { margin-top: 26px; display: grid; gap: 10px; }
.size-links-group .size-links { margin-top: 0; justify-content: flex-start; }
.size-links-group .size-links__list { justify-content: flex-start; }
.result__notice { margin-top: 6px; font-size: 14.5px; font-weight: 600; }
.result__notice.is-ok { color: #1d8348; }
.result__notice.is-warn { color: #a15c00; }

/* ---------------------------------------------------------------- bands & features */

.band { background: var(--bg-warm); border-block: 1px solid #f0e8e2; padding: 64px 0; }
.how { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: how; }
.how__step { text-align: center; padding: 0 12px; }
.how__num {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
    border-radius: 50%; background: #fff; border: 2px solid var(--brand); color: var(--brand);
    font-weight: 800; font-size: 18px;
}
.how__step h3 { font-size: 18px; margin-bottom: 6px; }
.how__step p { color: var(--ink-2); font-size: 15px; }

.features-section { padding: 64px 20px 24px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.feature__icon { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 15px; }
.features--tool { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------------------------------------------------------- FAQ */

.faq-section { padding: 56px 20px; }
.faq { border-top: 1px solid var(--line); max-width: 880px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
    list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 2px; cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary h3 { font-size: 17px; font-weight: 600; }
.faq__item summary svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .2s; }
.faq__item[open] summary svg { transform: rotate(180deg); }
.faq__item summary:hover h3 { color: var(--brand); }
.faq__answer { padding: 0 2px 20px; color: var(--ink-2); max-width: 760px; }
.faq__answer a { color: var(--brand); text-decoration: underline; }

/* ---------------------------------------------------------------- tool page hero */

.tool-hero { padding: 26px 0 8px; text-align: center; }
.tool-hero__title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; margin-top: 18px; }
.tool-hero__lead { max-width: 700px; margin: 12px auto 0; font-size: clamp(16px, 1.7vw, 18.5px); color: var(--ink-2); }
.tool-hero--hub { padding-bottom: 28px; }
.tool-hero--page { text-align: start; }
.tool-hero--page .tool-hero__lead { margin-inline: 0; font-size: 15px; color: var(--muted); }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.tool-hero--page .breadcrumbs ol { justify-content: flex-start; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-2); }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink-2); }

/* ---------------------------------------------------------------- converter */

.converter { position: relative; padding: 24px 0 48px; }
.converter__stage { display: none; }
.converter[data-state="empty"] .converter__stage--empty,
.converter[data-state="ready"] .converter__stage--ready,
.converter[data-state="working"] .converter__stage--working,
.converter[data-state="done"] .converter__stage--done,
.converter[data-state="error"] .converter__stage--error { display: block; }
.converter[data-state="ready"] .converter__stage--ready { display: grid; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    min-height: 300px; padding: 40px 20px; max-width: 920px; margin-inline: auto;
    border: 2px dashed #e8b9b0; border-radius: 18px; background: #fff8f6;
    transition: background-color .15s, border-color .15s;
}
.dropzone.is-over { background: var(--brand-soft); border-color: var(--brand); }
.dropzone__btn { box-shadow: 0 6px 18px rgba(229, 69, 47, .25), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.dropzone__or { margin-top: 14px; color: var(--ink-2); font-weight: 500; }
.dropzone__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }

.converter__privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.converter__privacy svg { width: 16px; height: 16px; }

.url-box { max-width: 760px; margin-inline: auto; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.url-box__label { display: block; font-weight: 700; margin-bottom: 10px; }
.url-box__row { display: flex; gap: 10px; }
.url-box__row input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 16px; direction: ltr; }
.url-box__row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.url-box .hint { margin-top: 10px; }

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

/* workspace */
.workspace { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.workspace__files { min-height: 320px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
.workspace__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.workspace__count { font-weight: 700; }
.workspace__files .hint { margin: -6px 0 12px; }
.workspace__panel {
    position: sticky; top: calc(var(--header-h) + 16px);
    padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow);
}
.workspace__title { font-size: 19px; font-weight: 800; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.workspace__note { font-size: 14.5px; color: var(--ink-2); margin-bottom: 18px; }
.workspace__panel .btn--link { margin-top: 6px; }

.file-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file {
    position: relative; display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: box-shadow .15s, opacity .15s;
}
.file[draggable="true"] { cursor: grab; }
.file.is-dragging { opacity: .4; }
.file.is-drop-target { box-shadow: 0 0 0 2px var(--brand); }
.file__preview { display: grid; place-items: center; aspect-ratio: 4 / 3.4; background: #fafbfc; border-bottom: 1px solid var(--line); overflow: hidden; }
.file__preview img { width: 100%; height: 100%; object-fit: contain; }
.file__preview .file-icon { width: 48px; }
.file__info { padding: 9px 10px 10px; min-width: 0; }
.file__name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__size { font-size: 12.5px; color: var(--muted); }
.file__index {
    position: absolute; top: 8px; inset-inline-start: 8px; min-width: 22px; height: 22px; padding: 0 6px;
    display: grid; place-items: center; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
}
.file__tools { position: absolute; top: 6px; inset-inline-end: 6px; display: flex; gap: 4px; }
.file__btn {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .95); color: var(--ink-2);
}
.file__btn:hover { color: var(--err); border-color: var(--line-2); }
.file__btn svg { width: 14px; height: 14px; }
.file__btn--move:hover { color: var(--ink); }
[dir="rtl"] .file__btn--move svg { transform: scaleX(-1); }

/* options */
.options { display: grid; gap: 18px; margin-bottom: 20px; }
.field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field__label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; padding: 0; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; }
.field__value { font-size: 14px; font-weight: 700; color: var(--brand); }
.field__help { margin-top: 6px; font-size: 13px; color: var(--muted); }
.field[hidden] { display: none; }

.input, .select select {
    width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-size: 15px;
}
.input:focus, .select select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.is-invalid { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.select { position: relative; }
.select select { appearance: none; padding-inline-end: 34px; cursor: pointer; }
.select::after {
    content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
    border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2); transform: rotate(45deg); pointer-events: none;
}

.segmented { display: flex; padding: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; gap: 3px; }
.segmented__opt { flex: 1; position: relative; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__opt span {
    display: grid; place-items: center; height: 36px; padding: 0 8px; border-radius: 7px; text-align: center;
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.15;
}
.segmented__opt input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented__opt input:focus-visible + span { outline: 2px solid var(--brand); }

.choice-cards { display: grid; gap: 8px; }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card__body { display: block; padding: 12px 14px 12px 40px; border: 1px solid var(--line-2); border-radius: 10px; transition: border-color .15s, background-color .15s; }
[dir="rtl"] .choice-card__body { padding: 12px 40px 12px 14px; }
.choice-card__body::before {
    content: ""; position: absolute; inset-inline-start: 14px; top: 15px; width: 16px; height: 16px; border-radius: 50%;
    border: 1.8px solid var(--line-2); background: #fff;
}
.choice-card input:checked + .choice-card__body { border-color: var(--brand); background: #fff8f6; }
.choice-card input:checked + .choice-card__body::before { border-color: var(--brand); box-shadow: inset 0 0 0 3.5px #fff; background: var(--brand); }
.choice-card input:focus-visible + .choice-card__body { outline: 2px solid var(--brand); }
.choice-card__title { display: block; font-weight: 700; font-size: 14.5px; }
.choice-card__desc { display: block; font-size: 13px; color: var(--muted); }

input[type="range"] { width: 100%; accent-color: var(--brand); height: 24px; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; font-weight: 500; }
.check input { position: absolute; opacity: 0; }
.check__box { flex: none; width: 20px; height: 20px; border: 1.8px solid var(--line-2); border-radius: 6px; background: #fff; display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check__box::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:focus-visible + .check__box { outline: 2px solid var(--brand); outline-offset: 2px; }

.color-input { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 9px; }
.color-input input { width: 34px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.color-input span { font-size: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-2); direction: ltr; }

.form-error { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: var(--err-soft); color: var(--err); font-size: 14px; font-weight: 500; }

/* progress */
.progress-card, .error-card {
    max-width: 560px; margin-inline: auto; padding: 44px 28px; text-align: center;
    border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow);
}
.progress-card .tool-icon { margin: 0 auto 18px; }
.progress-card__label { font-size: 19px; font-weight: 700; margin-bottom: 16px; }
.progress { position: relative; height: 10px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.progress__bar { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: inherit; background: var(--brand); transition: width .2s; }
.progress.is-indeterminate .progress__bar { width: 35% !important; animation: indeterminate 1.2s ease-in-out infinite; }
@keyframes indeterminate { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
[dir="rtl"] .progress.is-indeterminate .progress__bar { animation-name: indeterminate-rtl; }
@keyframes indeterminate-rtl { 0% { transform: translateX(110%); } 100% { transform: translateX(-310%); } }
.progress-card__hint { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* result */
.result { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; max-width: 980px; margin-inline: auto; align-items: start; }
.result__main { padding: 40px 28px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.result__check { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 14px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.result__check svg { width: 30px; height: 30px; }
.result__title { font-size: 24px; font-weight: 800; }
.result__file { margin: 8px 0 4px; color: var(--ink-2); word-break: break-word; }
.result__file span { color: var(--muted); white-space: nowrap; }
.result__saved { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 14px; }
.result__main .btn--xl { margin-top: 22px; }
.result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.result__main .hint { margin-top: 10px; }
.result__next { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
.result__next-title { font-weight: 700; margin-bottom: 10px; }
.result__next ul { list-style: none; display: grid; gap: 6px; }
.result__next a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.result__next a:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }

.error-card__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; background: var(--err-soft); color: var(--err); }
.error-card__icon svg { width: 28px; height: 28px; }
.error-card h2 { font-size: 21px; margin-bottom: 8px; }
.error-card p { color: var(--ink-2); margin-bottom: 20px; }

.drop-overlay {
    position: fixed; inset: 0; z-index: 90; display: none; place-items: center;
    background: rgba(229, 69, 47, .1); backdrop-filter: blur(2px); pointer-events: none;
}
.drop-overlay.is-visible { display: grid; }
.drop-overlay__box { padding: 34px 48px; border-radius: 18px; border: 2px dashed var(--brand); background: #fff; color: var(--brand); text-align: center; font-weight: 700; font-size: 18px; box-shadow: var(--shadow-lg); }
.drop-overlay__box svg { width: 40px; height: 40px; margin: 0 auto 8px; }

/* ---------------------------------------------------------------- tool content */

.content-section { padding: 48px 20px 8px; }
.howto { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 36px; border-radius: 20px; background: var(--bg-warm); border: 1px solid #f0e8e2; }
.howto h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; margin-bottom: 18px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 44px; color: var(--ink-2); min-height: 30px; }
.steps li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; top: -2px;
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 800; font-size: 14px;
}
.steps strong { color: var(--ink); }
.howto__visual { display: grid; place-items: center; }
.howto__card { width: min(280px, 100%); padding: 30px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); transform: rotate(-2deg); }
[dir="rtl"] .howto__card { transform: rotate(2deg); }
.howto__card .tool-icon { margin: 0 auto 20px; }
.howto__bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin-bottom: 16px; }
.howto__bar span { display: block; width: 72%; height: 100%; background: var(--brand); border-radius: inherit; }
.howto__lines { display: grid; gap: 8px; }
.howto__lines span { height: 7px; border-radius: 99px; background: #eceef1; }
.howto__lines span:nth-child(2) { width: 82%; }
.howto__lines span:nth-child(3) { width: 58%; }

.prose { max-width: 800px; color: var(--ink-2); font-size: 16.5px; }
.prose p + p, .prose p + h2, .prose ul + h2, .prose ul + p { margin-top: 16px; }
.prose h2 { font-size: 22px; color: var(--ink); margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-inline-start: 22px; margin-top: 10px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose strong { color: var(--ink); }
.contact-mail { margin-top: 24px; }
.contact-mail .btn { text-decoration: none; color: #fff; }

.formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.format { display: flex; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.format__icon { width: 42px !important; flex: none; }
.format h3 { font-size: 17px; margin-bottom: 6px; }
.format p { color: var(--ink-2); font-size: 15px; }

.related { padding-bottom: 64px; }
.hub-group { padding: 28px 20px 12px; }
.hub-group:last-of-type { padding-bottom: 32px; }
.prose-section { padding-bottom: 56px; }

.error-page { padding: 72px 20px; text-align: center; }
.error-page__code { font-size: 15px; font-weight: 800; letter-spacing: .1em; color: var(--brand); }
.error-page h1 { font-size: clamp(28px, 4vw, 40px); margin: 8px 0 10px; }
.error-page > p { color: var(--ink-2); margin-bottom: 24px; }
.error-page__tools { margin-top: 48px; text-align: start; }

/* ---------------------------------------------------------------- footer */

.site-footer { margin-top: 32px; background: #16171b; color: #b9bdc7; font-size: 14.5px; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.site-footer__brand p { margin-top: 14px; max-width: 300px; line-height: 1.6; }
.site-footer__langs { list-style: none; display: flex; gap: 14px; margin-top: 18px; }
.site-footer__langs a { color: #fff; font-weight: 600; }
.site-footer__langs a:hover { text-decoration: underline; }
.site-footer__title { color: #fff; font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.site-footer__col ul { list-style: none; display: grid; gap: 8px; }
.site-footer__col a:hover { color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid #2a2c33; font-size: 13.5px; color: #8b909c; }
.site-footer__note { display: inline-flex; align-items: center; gap: 6px; }
.site-footer__note svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
    .tool-grid, .tool-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pair-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
    .site-footer__brand { grid-column: 1 / -1; }
    .nav__link--plain { display: none; }
}

@media (max-width: 900px) {
    :root { --header-h: 58px; }
    .nav-toggle { display: inline-flex; }
    .nav {
        position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 12px 16px 40px; background: #fff; overflow-y: auto;
        transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility 0s .2s;
    }
    [dir="rtl"] .nav { transform: translateX(100%); }
    .nav.is-open { transform: none; visibility: visible; transition: transform .2s; }
    .nav__link { width: 100%; justify-content: space-between; height: 50px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav__link--plain { display: flex; }
    .nav__link:hover, .nav__link[aria-expanded="true"] { background: none; }
    .mega {
        position: static; width: auto; padding: 8px 0 16px; border: 0; box-shadow: none; display: none;
        opacity: 1; visibility: visible; transform: none; transition: none;
    }
    .nav__item--menu.is-open .mega { display: block; }
    .mega__grid, .mega--image .mega__grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .mega__col--wide { grid-column: 1 / -1; }
    body.nav-open { overflow: hidden; }

    .workspace { grid-template-columns: 1fr; }
    .workspace__panel { position: static; }
    .result { grid-template-columns: 1fr; }
    .howto { grid-template-columns: 1fr; padding: 26px; }
    .howto__visual { display: none; }
    .features, .features--tool { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .how { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
    .container { padding-inline: 16px; }
    .hero { padding: 40px 0 16px; }
    .tool-grid, .tool-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tool-card { padding: 16px; }
    .tool-card__name { font-size: 15.5px; }
    .tool-card__desc { font-size: 13.5px; -webkit-line-clamp: 2; }
    .tool-icon--md { width: 40px; height: 40px; }
    .pair-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
    .filters::-webkit-scrollbar { display: none; }
    .filters__btn { flex: none; }
    .features, .features--tool, .formats { grid-template-columns: 1fr; }
    .dropzone { min-height: 240px; padding: 28px 16px; }
    .btn--xl { min-height: 58px; padding: 0 24px; font-size: 17px; }
    .url-box { padding: 20px; }
    .url-box__row { flex-direction: column; }
    .file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace__files { padding: 14px; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .mega__grid, .mega--image .mega__grid { grid-template-columns: 1fr; }
    .mega__col--wide ul { columns: 2; }
    .brand__name { font-size: 18px; }
}

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

/* ---------------------------------------------------------------- blog */

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.post-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.post-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card__link { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; }
.post-card__meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.post-card__title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.post-card__desc { font-size: 14.5px; color: var(--ink-2); flex: 1; }
.post-card__more { margin-top: 6px; font-size: 14.5px; font-weight: 700; color: var(--brand); }

.post-meta { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; gap: 6px; }
.post-tools { margin-bottom: 28px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.post-tools__title { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.post-tools ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tools a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.post-tools a:hover { border-color: var(--brand); color: var(--brand); }

.post-body { max-width: none; font-size: 17px; line-height: 1.7; }
.post-body h2 { font-size: 24px; margin-top: 36px; }
.post-body h3 { font-size: 19px; color: var(--ink); margin: 26px 0 8px; }
.post-body ol, .post-body ul { padding-inline-start: 24px; margin-top: 10px; }
.post-body li + li { margin-top: 8px; }
.post-body p + ol, .post-body p + ul, .post-body ol + p, .post-body ul + p, .post-body h3 + p { margin-top: 12px; }
.post-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15.5px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: start; }
.post-body th { background: var(--bg-soft); color: var(--ink); }
.post-body blockquote { margin: 20px 0; padding: 14px 18px; border-inline-start: 4px solid var(--brand); background: var(--bg-warm); border-radius: 0 10px 10px 0; color: var(--ink); }
[dir="rtl"] .post-body blockquote { border-radius: 10px 0 0 10px; }
.post-body blockquote p { margin: 0; }
.post-body code { padding: 1px 6px; border-radius: 5px; background: var(--bg-soft); font-size: .92em; }
.post-body a { font-weight: 600; }

@media (max-width: 900px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-body { font-size: 16.5px; }
}

/* ---------------------------------------------------------------- contact form */

.contact-form { max-width: 800px; margin-top: 32px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: grid; gap: 18px; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form__message { height: auto; min-height: 160px; padding: 12px; line-height: 1.55; resize: vertical; font-family: inherit; }
.contact-form__trap { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.contact-form__status { padding: 12px 14px; border-radius: 10px; font-weight: 500; font-size: 15px; }
.contact-form__status.is-ok { background: var(--ok-soft); color: var(--ok); }
.contact-form__status.is-error { background: var(--err-soft); color: var(--err); }
@media (max-width: 640px) {
    .contact-form { padding: 18px; }
    .contact-form__row { grid-template-columns: 1fr; }
}
