:root {
    --bg: #f6f9fd;
    --surface: #ffffff;
    --text: #102348;
    --muted: #647593;
    --border: #dbe4ef;
    --accent: #1267e8;
    --accent-contrast: #ffffff;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(16, 35, 72, .08);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121217;
        --surface: #191c24;
        --text: #ececf1;
        --muted: #9a9aa8;
        --border: #303746;
        --accent: #7b93ff;
        --accent-contrast: #0e0e14;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #121217;
    --surface: #1c1c23;
    --text: #ececf1;
    --muted: #9a9aa8;
    --border: #2c2c36;
    --accent: #7b93ff;
    --accent-contrast: #0e0e14;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f6f9fd;
    --surface: #ffffff;
    --text: #102348;
    --muted: #647593;
    --border: #dbe4ef;
    --accent: #1267e8;
    --accent-contrast: #ffffff;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--text);
    font: 16px/1.5 Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { flex: 1; padding-block: 24px 48px; }
a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

.container { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: 20px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header { position: relative; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; height: 82px; max-width: 1280px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.5rem; letter-spacing: -.04em; }
.logo__accent { color: var(--accent); }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__actions { margin-inline-start: auto; }

.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; gap: 7px; min-height: 42px; list-style: none; cursor: pointer; border: 1px solid var(--border); border-radius: 21px; padding: 7px 11px; background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 700; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lang-menu summary .lang-menu__chevron { width: 14px; height: 14px; transition: transform .2s ease; }
.lang-menu[open] .lang-menu__chevron { transform: rotate(180deg); }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 20; margin: 0; padding: 8px; list-style: none; min-width: 190px; max-height: min(70vh, 420px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.lang-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.lang-menu a:hover { background: var(--bg); }
.lang-menu a[aria-current] { font-weight: 600; color: var(--accent); }

.theme-toggle { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; background: var(--surface); color: var(--accent); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; }
.theme-toggle svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle__moon { display: block; }
}
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding-block: 16px; }
.site-footer p { margin: 4px 0; }

.home-main { max-width: 1280px; padding-bottom: 72px; }
.home-hero { max-width: 940px; margin-inline: auto; padding: 70px 0 47px; text-align: center; }
.home-hero h1 { display: flex; flex-direction: column; margin: 0; font-size: clamp(2.8rem, 5.1vw, 4rem); line-height: 1.1; letter-spacing: -.045em; }
.home-hero h1 strong { color: var(--accent); }
.home-hero > p { max-width: 680px; margin: 24px auto 0; color: var(--muted); font-size: 1.2rem; }
.home-search-shell { position: relative; z-index: 10; margin-top: 40px; text-align: start; }
.home-search { display: flex; align-items: center; gap: 18px; width: 100%; height: 78px; padding: 0 24px; background: var(--surface); border: 2px solid var(--accent); border-radius: 16px; box-shadow: 0 0 0 0 rgba(18, 103, 232, 0); transition: box-shadow .2s ease; }
.home-search:focus-within { box-shadow: 0 0 0 5px rgba(18, 103, 232, .11); }
.home-search > svg { flex: none; width: 27px; height: 27px; fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; }
.home-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.25rem; }
.home-search input::-webkit-search-cancel-button { display: none; }
.home-search input::placeholder { color: #8291aa; opacity: 1; }
.home-search__clear { display: grid; flex: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--bg); color: var(--muted); cursor: pointer; }
.home-search__clear:hover { color: var(--text); }
.home-search__clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.home-search-results { position: absolute; inset-inline: 0; top: calc(100% + 10px); max-height: min(62vh, 470px); overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 48px rgba(16, 35, 72, .18); }
.search-result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px 14px; border-radius: 11px; color: var(--text); text-decoration: none; }
.search-result:hover, .search-result.is-active { background: var(--bg); }
.search-result strong, .search-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: .96rem; }
.search-result small { color: var(--muted); font-size: .78rem; }
.search-result span { overflow: hidden; margin-bottom: 1px; color: var(--accent); font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.search-results-empty { margin: 0; padding: 18px 14px; color: var(--muted); text-align: center; }
.home-privacy { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text) !important; font-size: .94rem !important; font-weight: 600; }
.home-privacy span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e1f7f1; color: #079078; }
.home-privacy svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool-directory { padding-top: 34px; border-top: 1px solid var(--border); scroll-margin-top: 24px; }
.tool-directory__header { text-align: center; }
.tool-directory__header h2 { margin: 0; font-size: 2.8rem; line-height: 1.15; letter-spacing: -.035em; }
.tool-directory__columns { column-count: 2; column-gap: 80px; margin-top: 44px; }
.directory-category { break-inside: avoid; margin-bottom: 58px; scroll-margin-top: 24px; }
.tool-directory__columns #category-pdf { break-before: column; }
.directory-category__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 0 22px; }
.directory-category__link { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 18px; min-width: 0; border-radius: 12px; color: var(--text); text-decoration: none; }
.directory-category__link:hover strong { color: var(--accent); }
.directory-category__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.directory-category__toggle { display: none; }
.category-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 15px; }
.category-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.category-icon--image { color: #1267e8; background: #e8f1ff; }
.category-icon--pdf { color: #e6454f; background: #fff0f0; }
.category-icon--office { color: #1d7a46; background: #e7f5ec; }
.category-icon--text { color: #098a74; background: #e6f8f3; }
.category-icon--dev { color: #7541d6; background: #f0ebff; }
.category-icon--media { color: #e4990d; background: #fff5de; }
.category-icon--convert { color: #168e7d; background: #e7f6f3; }
.category-icon--security { color: #4670c8; background: #eaf0ff; }
.category-icon--fun { color: #c05d20; background: #fff0e5; }
.category-icon--other { color: #66758f; background: #f2f4f8; }
.directory-category__heading { display: flex; flex-direction: column; min-width: 0; }
.directory-category__heading strong { font-size: 1.55rem; line-height: 1.25; letter-spacing: -.025em; }
.directory-category__heading small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .86rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.directory-category__count, .directory-category__chevron { display: none; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; gap: 14px; min-height: 66px; padding: 10px 2px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.tool-row:hover strong { color: var(--accent); }
.tool-row > span { min-width: 0; }
.tool-row strong, .tool-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-row strong { font-size: .98rem; line-height: 1.35; }
.tool-row small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.tool-row > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; color: var(--muted); margin-top: 32px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
    display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); text-decoration: none; box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card__icon { grid-row: span 2; font-size: 1.6rem; line-height: 1.2; }
.tool-card__title { font-weight: 600; }
.tool-card__desc { color: var(--muted); font-size: .9rem; }

@media (max-width: 820px) {
    main { padding-top: 0; }
    .container { padding-inline: 20px; }
    .site-header__inner { height: 72px; }
    .logo { gap: 9px; font-size: 1.3rem; }
    .logo img { width: 30px; height: 30px; }
    .lang-menu summary { min-height: 38px; padding: 6px 9px; }
    .lang-menu summary > svg:first-child { display: none; }
    .lang-menu ul { position: fixed; inset-inline: 20px; top: 66px; min-width: 0; }
    .theme-toggle { width: 38px; height: 38px; }

    .home-main { padding-bottom: 48px; }
    .home-hero { padding: 30px 0 31px; text-align: start; }
    .home-hero h1 { font-size: clamp(2.15rem, 10vw, 2.7rem); line-height: 1.05; }
    .home-hero > p { margin-top: 18px; font-size: .98rem; }
    .home-search-shell { margin-top: 27px; }
    .home-search { height: 62px; padding: 0 18px; border-radius: 13px; }
    .home-search > svg { width: 23px; height: 23px; }
    .home-search input { font-size: 1rem; }
    .home-search-results { max-height: 52vh; border-radius: 13px; }
    .search-result { padding: 11px 10px; }
    .home-privacy { justify-content: center; margin-top: 22px !important; text-align: center; font-size: .79rem !important; }
    .home-privacy span { width: 28px; height: 28px; }
    .home-privacy svg { width: 16px; height: 16px; }

    .tool-directory { padding-top: 27px; }
    .tool-directory__header { text-align: start; }
    .tool-directory__header h2 { font-size: 1.85rem; }
    .tool-directory__columns { display: flex; flex-direction: column; gap: 0; margin-top: 22px; }
    #category-image { order: 1; }
    #category-pdf { order: 2; }
    #category-office { order: 3; }
    #category-text { order: 4; }
    #category-dev { order: 5; }
    #category-media { order: 6; }
    #category-convert { order: 7; }
    #category-security { order: 8; }
    #category-other { order: 9; }
    .directory-category { margin-bottom: 0; }
    .directory-category + .directory-category { margin-top: 8px; }
    .directory-category__header { gap: 4px; min-height: 62px; padding: 0 4px 0 10px; border-bottom: 1px solid var(--border); }
    .directory-category__link { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 9px 0; }
    /* Назва веде на сторінку категорії, а кнопка з лічильником і стрілкою розгортає список. */
    .directory-category__toggle { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 64px; min-height: 48px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
    .directory-category__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .directory-category.is-expanded .directory-category__header { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
    .category-icon { width: 42px; height: 42px; border-radius: 10px; }
    .category-icon svg { width: 22px; height: 22px; }
    .directory-category__heading strong { font-size: .96rem; letter-spacing: 0; }
    .directory-category__heading small { display: none; }
    .directory-category__count { display: block; color: var(--muted); font-size: .8rem; }
    .directory-category__chevron { display: block; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
    .directory-category.is-expanded .directory-category__chevron { transform: rotate(180deg); }
    .directory-category__tools { display: none; }
    .directory-category.is-expanded .directory-category__tools { display: block; }
    .tool-row { min-height: 57px; padding: 8px 2px; }
    .tool-row strong { font-size: .89rem; }
    .tool-row small { font-size: .7rem; }
}

@media (max-width: 390px) {
    .lang-menu summary span { font-size: .74rem; }
}

[dir="rtl"] .tool-row > svg { transform: scaleX(-1); }

.tool-page { background: var(--bg); }
.tool-main { max-width: 1240px; padding-top: 28px; padding-bottom: 72px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; color: var(--muted); font-size: .86rem; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs svg { display: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.breadcrumbs__separator { opacity: .55; }

.tool__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 40px; }
.tool__intro { min-width: 0; }
.tool__title-row { display: flex; align-items: center; gap: 14px; }
.tool__icon { flex: none; width: 52px; height: 52px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.tool-page .category-icon--image { color: #5794f5; background: color-mix(in srgb, #1267e8 13%, var(--surface)); }
.tool-page .category-icon--pdf { color: #ed6870; background: color-mix(in srgb, #e6454f 13%, var(--surface)); }
.tool-page .category-icon--office { color: #4cb37a; background: color-mix(in srgb, #1d7a46 13%, var(--surface)); }
.tool-page .category-icon--text { color: #3fb79f; background: color-mix(in srgb, #098a74 13%, var(--surface)); }
.tool-page .category-icon--dev { color: #9a77e8; background: color-mix(in srgb, #7541d6 13%, var(--surface)); }
.tool-page .category-icon--media { color: #eab34e; background: color-mix(in srgb, #e4990d 13%, var(--surface)); }
.tool-page .category-icon--convert { color: #42b7a5; background: color-mix(in srgb, #168e7d 13%, var(--surface)); }
.tool-page .category-icon--security { color: #7199e8; background: color-mix(in srgb, #4670c8 13%, var(--surface)); }
.tool-page .category-icon--fun { color: #df854c; background: color-mix(in srgb, #c05d20 13%, var(--surface)); }
.tool-page .category-icon--other { color: #8b9ab3; background: color-mix(in srgb, #66758f 13%, var(--surface)); }
.tool__header h1 { min-width: 0; margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
.tool__header p { max-width: 830px; margin: 12px 0 0; color: var(--muted); font-size: 1.02rem; }
.tool__privacy { padding-bottom: 7px; color: #16866f; font-size: .82rem; font-weight: 600; white-space: nowrap; }
:root[data-theme="dark"] .tool__privacy { color: #67d8b4; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tool__privacy { color: #67d8b4; }
}

.tool__body { margin-top: 28px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 36px rgba(16, 35, 72, .06); }
.tool__body [hidden] { display: none !important; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label, .fr-label { color: var(--text); font-size: .88rem; font-weight: 650; }
.input, .textarea, .select { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px; outline: 0; background: color-mix(in srgb, var(--bg) 72%, var(--surface)); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.select { appearance: none; padding-inline-end: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%238b9ab3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px; }
[dir="rtl"] .select { background-position: left 13px center; }
.input:hover, .textarea:hover, .select:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.textarea { min-height: 220px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6; }
.input[type="range"] { min-height: 30px; padding: 0; accent-color: var(--accent); box-shadow: none; }
.input[type="color"] { height: 46px; padding: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.row > .field { flex: 1 1 170px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-block: 16px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s, background .15s, transform .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn--primary { border-color: var(--accent); background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); color: var(--accent-contrast); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.check { display: inline-flex; align-items: flex-start; gap: 9px; min-height: 28px; color: var(--text); font-size: .92rem; cursor: pointer; }
.check input { flex: none; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.hint { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.error { margin: 8px 0; color: #c92a55; font-size: .88rem; font-weight: 600; }

.dropzone { display: flex; min-height: 156px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 28px 20px; border: 1.5px dashed color-mix(in srgb, var(--accent) 42%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 3%, var(--surface)); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text); }
.dropzone strong { color: var(--text); font-size: 1rem; }

.tabs { display: inline-flex; max-width: 100%; flex-wrap: wrap; gap: 3px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); }
.tabs button { min-height: 38px; padding: 7px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(16, 35, 72, .09); font-weight: 650; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 0; margin-block: 20px 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stat { min-width: 0; padding: 16px; border-inline-end: 1px solid var(--border); background: transparent; }
.stat:last-child { border-inline-end: 0; }
.stat__value { color: var(--text); font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 750; line-height: 1.2; word-break: break-word; }
.stat:first-child .stat__value { color: var(--accent); }
.stat__label { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.output { min-height: 46px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }

.file-list { display: flex; flex-direction: column; gap: 0; margin: 18px 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; list-style: none; }
.file-list:empty { display: none; }
.file-list li { display: flex; min-height: 72px; align-items: center; gap: 14px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--surface); }
.file-list li:last-child { border-bottom: 0; }
.file-list .grow { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list img, .file-list canvas { width: 52px; height: 52px; flex: none; border-radius: 8px; object-fit: cover; }
.preview { display: block; max-width: 100%; max-height: 540px; margin: 18px auto; border: 1px solid var(--border); border-radius: 10px; background: repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.progress { width: 100%; height: 8px; accent-color: var(--accent); }

.tool--text .textarea { min-height: 280px; }
.tool--text .grid-2 { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
.tool--calculator .tool__body > .stats:first-of-type { margin-top: 8px; }
.tool--calculator .stat:first-child { grid-column: span 2; }
.tool--media .preview, .tool--media canvas, .tool--media video, .tool--media audio { max-width: 100%; }
.tool--media .tool__body { background: color-mix(in srgb, var(--surface) 96%, var(--accent)); }

.share { position: relative; flex: none; }
.share > summary { list-style: none; }
.share > summary::-webkit-details-marker { display: none; }
.share__trigger { display: inline-flex; min-height: 40px; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 650; cursor: pointer; user-select: none; }
.share__trigger:hover, .share[open] .share__trigger { border-color: var(--accent); color: var(--accent); }
.share__trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 20; width: 190px; padding: 7px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.share__option { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .88rem; text-align: start; text-decoration: none; cursor: pointer; }
.share__option:hover { background: var(--bg); color: var(--accent); }

.tool-support { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 32px 64px; margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--border); }
.tool-support h2, .related h2 { margin: 0 0 18px; font-size: 1.35rem; line-height: 1.25; letter-spacing: -.02em; }
.tool-support__about { grid-column: 1 / -1; }
.tool-support__about p { max-width: 82ch; margin: 0; color: var(--muted); }
.tool-support__list { margin: 0; padding-inline-start: 1.2em; color: var(--muted); }
.tool-support__list li + li { margin-top: 8px; }
.steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 12px; color: var(--muted); }
.steps__number { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 50%; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); font-size: .82rem; font-weight: 750; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.steps__text { padding-top: 5px; }
.faq { border-top: 1px solid var(--border); }
.faq details { max-width: none; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; color: var(--text); cursor: pointer; font-weight: 650; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { flex: none; color: var(--muted); content: "+"; font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: -3px 0 16px; color: var(--muted); }

.related { margin-top: 56px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 13px; min-height: 84px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: none; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 10px; }
.tool-card__icon svg { width: 22px; height: 22px; }
.tool-card__title { align-self: end; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tool-card__desc { align-self: start; overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.feature { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.feature h3 { margin: 0 0 6px; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; padding: 10px 18px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: .9rem; transform: translateX(-50%); }

@media (max-width: 900px) {
    .tool-main { padding-top: 22px; }
    .tool__header { grid-template-columns: 1fr; gap: 12px; }
    .tool__privacy { padding: 0; }
    .tool--text .grid-2, .grid-2 { grid-template-columns: 1fr; }
    .tool-support { grid-template-columns: 1fr; gap: 36px; }
    .tool-support__about { grid-column: auto; }
}

@media (max-width: 620px) {
    .tool-main { padding-inline: 16px; padding-bottom: 52px; }
    .breadcrumbs { margin: 18px 0 22px; font-size: .88rem; }
    .breadcrumbs svg { display: block; }
    .breadcrumbs__separator, .breadcrumbs__category { display: none !important; }
    .tool__title-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px; align-items: start; gap: 11px; }
    .tool__icon { width: 44px; height: 44px; border-radius: 11px; }
    .tool__icon svg { width: 23px; height: 23px; }
    .tool__header h1 { align-self: center; font-size: clamp(1.65rem, 8vw, 2.1rem); }
    .tool__header p { margin-top: 14px; font-size: .95rem; }
    .tool__privacy { font-size: .78rem; white-space: normal; }
    .share__trigger { width: 40px; height: 40px; justify-content: center; padding: 0; }
    .share__trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .share__menu { position: fixed; inset-inline: 16px; top: auto; bottom: 16px; width: auto; }
    .tool__body { margin-top: 22px; padding: 16px; border-radius: 13px; }
    .input, .select { min-height: 48px; }
    .textarea { min-height: 240px; }
    .row { gap: 0 10px; }
    .row > .field { flex-basis: 100%; }
    .actions .btn { flex: 1 1 auto; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool--calculator .stat:first-child { grid-column: 1 / -1; }
    .stat { border-bottom: 1px solid var(--border); }
    .file-list li { min-height: 68px; padding: 9px 10px; }
    .file-list img, .file-list canvas { width: 48px; height: 48px; }
    .tool-support { margin-top: 42px; padding-top: 30px; }
    .tool-support h2, .related h2 { font-size: 1.25rem; }
    .related { margin-top: 44px; }
    .tool-grid { grid-template-columns: 1fr; }
}

/* Сторінка категорії */
.directory-category__more { display: inline-block; margin-top: 14px; font-size: .9rem; font-weight: 600; text-decoration: none; }
.directory-category__more:hover { text-decoration: underline; }
.category-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 20px; margin-bottom: 40px; }
.category-hero h1 { margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
.category-hero p { max-width: 830px; margin: 12px 0 0; color: var(--muted); font-size: 1.02rem; }
.category-hero .category-hero__privacy { font-size: .9rem; }
.category-tools h2, .category-tasks h2, .category-others h2 { margin: 0 0 18px; font-size: 1.35rem; line-height: 1.25; letter-spacing: -.02em; }
.category-tools__count { color: var(--muted); font-weight: 400; }
.category-tasks, .category-others { margin-top: 48px; }
.category-tasks ul, .category-others ul { margin: 0; padding: 0; list-style: none; }
.category-tasks li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.category-tasks li a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.category-tasks li a:hover { text-decoration: underline; }
.category-others ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.category-others a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.category-others a:hover { border-color: var(--accent); }
.category-others .category-icon { width: 38px; height: 38px; border-radius: 10px; }
.category-others .category-icon svg { width: 20px; height: 20px; }
.category-others small { margin-inline-start: auto; color: var(--muted); }

@media (max-width: 620px) {
    .category-hero { grid-template-columns: 1fr; gap: 14px; margin-bottom: 28px; }
    .category-hero .category-icon { width: 44px; height: 44px; border-radius: 11px; }
    .category-tasks li { flex-direction: column; }
    .category-tasks li a { white-space: normal; }
}
