/* =========================================================
   AI Каталог — шаблон DLE 19
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
	--bg: #f6f7f9;
	--surface: #ffffff;
	--surface-2: #f0f2f5;
	--surface-3: #e7eaef;
	--text: #0f1729;
	--text-2: #3b4456;
	--muted: #687387;
	--border: #e3e6ec;
	--border-strong: #cfd4dd;

	--accent: #0f9f6e;
	--accent-strong: #0b7f58;
	--accent-soft: #e3f6ee;
	--accent-text: #0a6a4a;
	--on-accent: #ffffff;

	--blue: #2563eb;  --blue-soft: #e7eefe;  --blue-text: #1d4fc4;
	--amber: #b45309; --amber-soft: #fdf1df; --amber-text: #92400e;
	--violet: #7c3aed; --violet-soft: #f0e9fe; --violet-text: #6427cf;
	--red: #dc2626;   --red-soft: #fde8e8;   --red-text: #b91c1c;
	--green-dot: #16a34a;

	--radius: 14px;
	--radius-sm: 10px;
	--radius-xs: 7px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 41, .05);
	--shadow: 0 1px 2px rgba(15, 23, 41, .04), 0 6px 20px rgba(15, 23, 41, .06);
	--shadow-lg: 0 10px 40px rgba(15, 23, 41, .12);

	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1240px;
	--gutter: 16px;
	--header-h: 64px;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0b0f17;
		--surface: #121826;
		--surface-2: #182033;
		--surface-3: #212b40;
		--text: #e8ebf1;
		--text-2: #c3c9d5;
		--muted: #8e98ab;
		--border: #232d42;
		--border-strong: #33405b;
		--accent: #2fc28c;
		--accent-strong: #4fd6a3;
		--accent-soft: rgba(47, 194, 140, .14);
		--accent-text: #62dcae;
		--on-accent: #04130d;
		--blue-soft: rgba(96, 140, 255, .15);   --blue-text: #8fb0ff;
		--amber-soft: rgba(245, 170, 60, .15);  --amber-text: #f5bd6b;
		--violet-soft: rgba(167, 128, 255, .16); --violet-text: #c2a8ff;
		--red-soft: rgba(248, 100, 100, .15);   --red-text: #ff9a9a;
		--shadow-sm: none;
		--shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .35);
		--shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #0b0f17;
	--surface: #121826;
	--surface-2: #182033;
	--surface-3: #212b40;
	--text: #e8ebf1;
	--text-2: #c3c9d5;
	--muted: #8e98ab;
	--border: #232d42;
	--border-strong: #33405b;
	--accent: #2fc28c;
	--accent-strong: #4fd6a3;
	--accent-soft: rgba(47, 194, 140, .14);
	--accent-text: #62dcae;
	--on-accent: #04130d;
	--blue-soft: rgba(96, 140, 255, .15);   --blue-text: #8fb0ff;
	--amber-soft: rgba(245, 170, 60, .15);  --amber-text: #f5bd6b;
	--violet-soft: rgba(167, 128, 255, .16); --violet-text: #c2a8ff;
	--red-soft: rgba(248, 100, 100, .15);   --red-text: #ff9a9a;
	--shadow-sm: none;
	--shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .35);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 16px/1.55 var(--font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 1em; }
.muted, .grey { color: var(--muted); }
.title_hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
svg.icon { display: none; } /* иконки старого спрайта DLE в служебных шаблонах */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

/* ---------- Buttons ---------- */
.btn, .btn-big, .btn-border, .btn-white,
button.bbcodes, input.bbcodes, .ui-button {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	min-height: 40px; padding: 0 16px;
	font: 600 14px/1 var(--font);
	color: var(--text); background: var(--surface-2);
	border: 1px solid var(--border); border-radius: var(--radius-sm);
	cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover, .btn-big:hover, .btn-border:hover, .bbcodes:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn--primary, .btn-big, .form_submit .btn, .ui-form button[type="submit"] {
	background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.btn--primary:hover, .btn-big:hover, .form_submit .btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn--block { display: flex; width: 100%; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	color: var(--text-2); background: transparent;
	border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid var(--border);
}
.header__in { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -.02em; flex-shrink: 0; }
.logo:hover { color: var(--text); }
.logo__mark {
	display: grid; place-items: center; width: 34px; height: 34px;
	border-radius: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0;
	color: var(--on-accent); background: linear-gradient(135deg, var(--accent), #12b5a6);
}
.nav { display: flex; gap: 4px; }
.nav__link { padding: 8px 12px; border-radius: var(--radius-xs); color: var(--text-2); font-weight: 500; font-size: 15px; }
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link.is-active { color: var(--text); background: var(--surface-2); }

.search { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
.search__icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search .search__input {
	width: 100%; height: 40px; min-height: 0; padding: 0 12px 0 38px;
	font: 400 15px var(--font); color: var(--text);
	background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm);
}
.search .search__input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.header__tools { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }

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

/* user menu / dropdown */
.user-menu { position: relative; }
.user-menu__btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; background: transparent; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font: 500 14px var(--font); cursor: pointer; }
.user-menu__btn:hover { background: var(--surface-2); }
.user-menu__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3) center/cover no-repeat; flex-shrink: 0; }
.avatar--sm { width: 34px; height: 34px; }
.dropdown {
	position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
	display: none; flex-direction: column; min-width: 230px; padding: 6px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.user-menu.is-open .dropdown { display: flex; }
.dropdown > a { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-xs); color: var(--text); font-size: 14px; }
.dropdown > a:hover { background: var(--surface-2); }
.dropdown__danger { color: var(--red-text) !important; }
.dropdown--form { width: 290px; padding: 16px; gap: 12px; }
.dropdown__foot { display: flex; justify-content: space-between; font-size: 13px; }
.social-login { display: flex; flex-wrap: wrap; gap: 6px; }
.social-login:empty { display: none; }
.social-login a { padding: 4px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"],
input[type="number"], input[type="date"], input[type="tel"], select, textarea, .wide {
	width: 100%; min-height: 40px; padding: 8px 12px;
	font: 400 15px/1.4 var(--font); color: var(--text);
	background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* DLE service forms (registration, addnews, feedback, search, profile, pm) */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.box_in { padding: 24px; }
@media (max-width: 560px) { .box_in { padding: 18px; } }
.box .heading, .box h1, .box .h1 { font-size: 22px; margin-bottom: 18px; }
.ui-form { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ui-form > li { list-style: none; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group > label, .ui-form label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.form-group.imp > label::after { content: " *"; color: var(--red-text); }
.form-sep { height: 1px; background: var(--border); margin: 8px 0; border: 0; }
.form_submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.combo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .combo { grid-template-columns: 1fr; } }
.ui-c1, .ui-c2 { min-width: 0; }
.c-captcha, .captcha { display: flex; align-items: center; gap: 10px; }
.c-captcha img, .captcha img { border-radius: var(--radius-xs); }
.c-captcha input, .captcha input { max-width: 170px; }
.checkbox, .form-check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.page_form__inner, .page_form__form { display: block; }
table { border-collapse: collapse; width: 100%; }
td, th { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }

/* ---------- Chips & badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .chips a {
	display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
	font-size: 14px; font-weight: 500; color: var(--text-2);
	background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
	transition: border-color .15s, color .15s, background .15s;
}
.chip:hover, .chips a:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.chips--sm .chip, .chips--sm a { height: 30px; padding: 0 11px; font-size: 13px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
	display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
	font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap;
	border-radius: 6px; color: var(--text-2); background: var(--surface-2);
}
a.badge:hover { filter: brightness(.96); }
.badge--free { color: var(--accent-text); background: var(--accent-soft); }
.badge--freemium { color: var(--blue-text); background: var(--blue-soft); }
.badge--trial { color: var(--amber-text); background: var(--amber-soft); }
.badge--oss { color: var(--violet-text); background: var(--violet-soft); }
.badge--ok { color: var(--accent-text); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.badge--warn { color: var(--amber-text); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber-text) 45%, transparent); }
.badge--bad { color: var(--red-text); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red-text) 45%, transparent); }
.badge--plain { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden;
	padding: 56px 0 44px;
	background:
		radial-gradient(900px 340px at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
		radial-gradient(700px 300px at 95% 0%, color-mix(in srgb, #12b5a6 12%, transparent), transparent 70%);
	border-bottom: 1px solid var(--border);
}
.hero__in { text-align: center; max-width: 860px; }
.hero__eyebrow { display: inline-block; margin-bottom: 16px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; }
.hero__title { font-size: clamp(32px, 6vw, 56px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.hero__title span { color: var(--muted); font-weight: 700; }
.hero__lead { max-width: 640px; margin: 0 auto 28px; font-size: clamp(16px, 2.2vw, 18px); color: var(--text-2); }
.hero__search { position: relative; display: flex; gap: 8px; max-width: 640px; margin: 0 auto 20px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.hero__search .search__icon { left: 20px; }
.hero__search input { flex: 1; min-width: 0; height: 48px; padding: 0 12px 0 44px; border: 0; background: transparent; font-size: 16px; box-shadow: none !important; }
.hero__search .btn { height: 48px; border-radius: 12px; padding: 0 22px; }
.hero__chips { justify-content: center; }
@media (max-width: 560px) {
	.hero { padding: 36px 0 30px; }
	.hero__search .btn { padding: 0 14px; }
}

/* ---------- Sections ---------- */
.page { min-height: 60vh; padding-bottom: 56px; }
.section { margin-top: 44px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section__title { font-size: 22px; margin: 0; }
.section__more { font-weight: 600; font-size: 14px; white-space: nowrap; }
.section--news:has(.news-grid:empty) { display: none; }

/* category tiles */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cat-tile {
	display: flex; align-items: center; gap: 12px; padding: 14px;
	color: var(--text); background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius);
	transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cat-tile:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat-tile__name { flex: 1; font-weight: 600; font-size: 15px; line-height: 1.25; }
.cat-tile__count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-tile__count:empty, .cat-list__count:empty { display: none; }
@media (max-width: 560px) { .cat-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } .cat-tile { padding: 12px; gap: 10px; } .cat-tile__count { display: none; } .cat-tile__name { font-size: 14px; } }

.cat-ico { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; font-size: 20px; line-height: 1; background: var(--surface-2); }
.cat-ico--sm { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.cat-ico::before { content: "✨"; }
.cat-ico[data-cat="1"]::before { content: "💬"; }
.cat-ico[data-cat="2"]::before { content: "✍️"; }
.cat-ico[data-cat="3"]::before { content: "🎨"; }
.cat-ico[data-cat="4"]::before { content: "📷"; }
.cat-ico[data-cat="5"]::before { content: "🎬"; }
.cat-ico[data-cat="6"]::before { content: "🎙️"; }
.cat-ico[data-cat="7"]::before { content: "🎵"; }
.cat-ico[data-cat="8"]::before { content: "💻"; }
.cat-ico[data-cat="9"]::before { content: "📊"; }
.cat-ico[data-cat="10"]::before { content: "🖌️"; }
.cat-ico[data-cat="11"]::before { content: "🌐"; }
.cat-ico[data-cat="12"]::before { content: "🎓"; }
.cat-ico[data-cat="13"]::before { content: "⚡"; }
.cat-ico[data-cat="14"]::before { content: "🔎"; }
.cat-ico[data-cat="15"]::before { content: "📈"; }
.cat-ico[data-cat="16"]::before { content: "🧊"; }
.cat-ico[data-cat="17"]::before { content: "🤖"; }
.cat-ico[data-cat="18"]::before { content: "🖥️"; }
.cat-ico[data-cat="19"]::before { content: "🕵️"; }
.cat-ico[data-cat="20"]::before { content: "📰"; }

/* ---------- Tool cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.tool-grid > *, .cat-tiles > *, .news-grid > *, .related-grid > * { min-width: 0; }
.tool-card {
	position: relative; display: flex; flex-direction: column; gap: 12px;
	padding: 18px; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card.is-fixed { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tool-card__head { display: flex; align-items: center; gap: 12px; }
.tool-card__titles { flex: 1; min-width: 0; }
.tool-card__title { margin: 0; font-size: 17px; font-weight: 700; }
.tool-card__title a { color: var(--text); }
.tool-card__cat { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-card__cat a { color: var(--muted); position: relative; z-index: 2; }
.tool-card__cat a:hover { color: var(--accent-text); }
.tool-card__desc { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card__overlay { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tool-card__fav { position: relative; z-index: 2; }
.fav { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; color: var(--muted); cursor: pointer; }
.fav:hover { background: var(--surface-2); color: var(--amber-text); }
.fav.is-on { color: #f59e0b; }

.tool-logo { position: relative; z-index: 2; display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.tool-logo img { width: 100%; height: 100%; object-fit: cover; }
/* DLE {title limit} режет по словам — показываем только первую букву */
.tool-logo__letter { display: block; font-size: 0; line-height: 1; }
.tool-logo__letter::first-letter { font-size: 20px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; }
/* фавикон сервиса поверх буквы; если не загрузился — onerror удаляет img и видна буква */
.tool-logo__fav { position: absolute; inset: 0; margin: auto; width: 32px !important; height: 32px !important; object-fit: contain; border-radius: 6px; }
.tool-logo:has(.tool-logo__fav) { background: #fff; }
.tool-logo:has(.tool-logo__fav) .tool-logo__letter { visibility: hidden; }
.tool-logo--lg .tool-logo__fav { width: 56px !important; height: 56px !important; border-radius: 12px; }
.tool-logo--lg { width: 88px; height: 88px; border-radius: 20px; }
.tool-logo--lg .tool-logo__letter::first-letter { font-size: 36px; }

/* ---------- News cards ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.news-card__img { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-card__img img { transform: scale(1.03); }
.news-card__ph { display: grid; place-items: center; height: 100%; font-weight: 800; font-size: 28px; color: var(--muted); }
.news-card__body { padding: 16px 18px 18px; }
.news-card__date { font-size: 13px; color: var(--muted); }
.news-card__title { font-size: 17px; margin: 6px 0 8px; }
.news-card__title a { color: var(--text); }
.news-card__title a:hover { color: var(--accent-text); }
.news-card__text { margin: 0; font-size: 14.5px; color: var(--text-2); }

/* ---------- Listing layout ---------- */
.crumbs { padding: 18px 0 6px; font-size: 14px; color: var(--muted); }
.speedbar a { color: var(--muted); }
.speedbar a:hover { color: var(--accent-text); }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 10px; }
.layout--single { grid-template-columns: minmax(0, 1fr); }
.layout__main { min-width: 0; }
.list-head { margin-bottom: 18px; }
.list-head__title { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.list-head__descr { color: var(--text-2); max-width: 760px; }
.list-head__descr:empty { display: none; }
.sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.sortbar ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.sortbar li a, .sortbar li { display: inline-block; }
.sortbar a, .sortbar li { color: var(--text-2) !important; }
.sortbar a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.sortbar a:hover { border-color: var(--accent); }
.sortbar .asc a, .sortbar .desc a { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.filters-toggle { display: none; margin-bottom: 16px; }

.sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; padding-bottom: 8px; scrollbar-width: thin; }
.side-block__title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.cat-list, .cat-list ul { list-style: none; margin: 0; padding: 0; }
.cat-list__link { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-xs); color: var(--text-2); font-size: 14.5px; }
.cat-list__link:hover { background: var(--surface-2); color: var(--text); }
.cat-list__link.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.cat-list__name { flex: 1; }
.cat-list__count { font-size: 12px; color: var(--muted); }
.side-filters { display: flex; flex-direction: column; }
.side-filters a { padding: 6px 8px; border-radius: var(--radius-xs); color: var(--text-2); font-size: 14.5px; }
.side-filters a:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 960px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.filters-toggle { display: inline-flex; }
	.sidebar {
		position: fixed; inset: 0 auto 0 0; z-index: 80; top: 0;
		width: min(320px, 86vw); max-height: none; padding: 20px;
		background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg);
		transform: translateX(-102%); transition: transform .2s ease;
	}
	body.sidebar-open .sidebar { transform: none; }
	body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 70; background: rgba(5, 10, 20, .45); }
}

/* pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 32px 0 8px; }
.pager__pages { display: contents; } /* стрелки и номера — один общий ряд */
.tool-grid > .pager, .news-grid > .pager { grid-column: 1 / -1; } /* DLE кладёт пагинацию внутрь сетки */
.pager a, .pager__pages > span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; }
.pager a:hover { border-color: var(--accent); color: var(--accent-text); }
.pager__pages > span:not(.nav_ext) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pager__pages > .nav_ext { border: 0; background: none; min-width: 20px; padding: 0; }
.pager > span { display: none; } /* неактивная стрелка на первой/последней странице */
.pager__arrow { font-size: 18px; line-height: 1; }

/* notices */
.notice { margin-bottom: 20px; padding: 16px 18px; background: var(--amber-soft); color: var(--text); border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--amber-text) 25%, transparent); }
.notice__title { display: block; margin-bottom: 4px; }
.notice__text { color: var(--text-2); }

/* ---------- Tool page ---------- */
.tool { padding-bottom: 24px; }
.tool-hero {
	display: grid; grid-template-columns: auto minmax(0, 1fr) 260px; gap: 24px; align-items: start;
	margin-top: 8px; padding: 28px; background: var(--surface);
	border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-sm);
}
.tool-hero__title { font-size: clamp(28px, 4.5vw, 40px); font-weight: 800; letter-spacing: -.025em; margin-bottom: 6px; }
.tool-hero__sub { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.tool-hero__lead { font-size: 16.5px; color: var(--text-2); margin-bottom: 16px; }
.tool-hero__cta { display: flex; flex-direction: column; gap: 10px; }
.tool-hero__cta > .btn--primary { width: 100%; }
.tool-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-hero__actions .btn { flex: 1; }
.tool-rating { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font-weight: 600; color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.rate-btn { cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.rate-btn:hover { background: var(--surface-2); }
@media (max-width: 960px) {
	.tool-hero { grid-template-columns: auto minmax(0, 1fr); }
	.tool-hero__cta { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.tool-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 16px; }
	.tool-logo--lg { width: 64px; height: 64px; border-radius: 16px; }
}

.tool-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; margin-top: 28px; align-items: start; }
.tool-body__side { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) {
	.tool-body { grid-template-columns: minmax(0, 1fr); }
	.tool-body__side { position: static; order: -1; }
}

.panel { padding: 20px 22px; border-radius: var(--radius); margin-bottom: 24px; }
.panel--free { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.panel__title { font-size: 18px; margin-bottom: 8px; color: var(--accent-text); }
.panel__text { white-space: pre-line; color: var(--text); }

.facts { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.facts__title { font-size: 16px; margin-bottom: 12px; }
.facts__list { margin: 0 0 16px; }
.facts__list > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.facts__list > div:last-child { border-bottom: 0; }
.facts__list dt { color: var(--muted); }
.facts__list dd { margin: 0; font-weight: 500; }
.facts__platforms { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.facts__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.facts__note a, .facts__note span { color: var(--accent-text); cursor: pointer; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.dot--ok { background: var(--green-dot); }
.dot--warn { background: #f59e0b; }
.dot--bad { background: var(--red); }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.pros-cons > section { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.pros-cons h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pros h3::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.cons h3::before { content: "−"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--red-soft); color: var(--red-text); }
.pros-cons__text { white-space: pre-line; font-size: 15px; color: var(--text-2); }
@media (max-width: 640px) { .pros-cons { grid-template-columns: 1fr; } }

.shots { margin: 28px 0; }
.shots h2 { font-size: 20px; }
.shots__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shots__list img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.shots__list br { display: none; }
.tool__tags { margin-top: 24px; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rel-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rel-card:hover { border-color: var(--accent); }
.rel-card__title { color: var(--text); font-weight: 600; }
.rel-card__cat { font-size: 13px; color: var(--muted); }

/* ---------- Prose (full text, static, news) ---------- */
.prose { font-size: 16.5px; line-height: 1.7; color: var(--text); }
.prose h2 { font-size: 24px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 19px; margin: 1.3em 0 .4em; }
.prose > :first-child, .prose > h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose img { border-radius: var(--radius-sm); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote, .quote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose pre, .prose code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.prose code { padding: 2px 6px; background: var(--surface-2); border-radius: 5px; }
.prose pre { padding: 14px 16px; overflow-x: auto; background: var(--surface-2); border-radius: var(--radius-sm); }
.prose pre code { padding: 0; background: none; }
.prose table { margin: 1.2em 0; font-size: 15px; display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td a { text-decoration: none; font-weight: 600; }

.cat-about { margin-top: 40px; padding: 24px 28px; max-width: 860px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 15.5px; color: var(--text-2); }
.cat-about h2 { font-size: 20px; color: var(--text); }
@media (max-width: 560px) { .cat-about { padding: 18px; } }
.article { max-width: 800px; margin: 0 auto; }
.article__head { margin: 8px 0 24px; }
.article__title { font-size: clamp(28px, 5vw, 42px); font-weight: 800; letter-spacing: -.025em; }
.article__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.article__tags { margin-top: 28px; }

/* ---------- Comments ---------- */
.comments { margin-top: 44px; max-width: 860px; }
.comments .section__title { margin-bottom: 16px; }
.com-list:empty { display: none; }
.comment { padding: 16px 18px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.comment__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment__who { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.comment__online { width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }
.comment__rate { font-size: 14px; color: var(--muted); }
.comment__news { font-weight: 600; margin-bottom: 6px; }
.comment__text { font-size: 15px; color: var(--text); }
.comment__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; }
.comment__actions a, .comment__actions span { color: var(--muted); cursor: pointer; }
.comment__actions a:hover { color: var(--accent-text); }
.add-comment { margin-top: 20px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.add-comment__title { font-size: 18px; margin-bottom: 14px; }
.add-comment .ui-form { gap: 12px; }
.add-comment__editor .bb-editor textarea { width: 100%; min-height: 84px; resize: vertical; }
.add-comment__count { margin-top: 6px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.add-comment__editor.is-full .add-comment__count { color: var(--amber-text); font-weight: 600; }
.add-comment__submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Search ---------- */
.search-card { margin-bottom: 12px; }
.search-item { padding: 16px 18px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.search-item__title { font-size: 17px; margin-bottom: 4px; }
.search-item__text { margin: 0 0 6px; font-size: 14.5px; color: var(--text-2); }
.search-item__meta { font-size: 13px; }
#searchsuggestions { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; overflow: hidden; }
#searchsuggestions a { display: block; padding: 10px 14px; color: var(--text) !important; border-bottom: 1px solid var(--border); }
#searchsuggestions a:hover { background: var(--surface-2); }
#searchsuggestions .searchheading { display: block; font-weight: 600; }
#searchsuggestions span:not(.searchheading) { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Install (PWA) block ---------- */
.install {
	position: relative; overflow: hidden;
	display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: center;
	padding: 32px 36px 0 36px; min-height: 280px;
	background:
		radial-gradient(520px 260px at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
		linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)) 100%);
	border: 1px solid var(--border); border-radius: 20px;
}
.install__text { padding-bottom: 32px; }
.install__host {
	display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 5px 12px;
	font-size: 13px; font-weight: 600; color: var(--accent-text);
	background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}
.install__host svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.install__title { font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.install__lead { max-width: 520px; color: var(--text-2); margin-bottom: 14px; }
.install__perks { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 22px; padding: 0; font-size: 14px; font-weight: 600; }
.install__perks li::before { content: "✓"; margin-right: 6px; color: var(--accent); font-weight: 800; }
.install__btn {
	min-height: 48px; padding: 0 24px; border-radius: 999px; font-size: 15px;
	color: var(--on-accent); background: var(--accent); border-color: var(--accent);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.install__btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.install__btn span { font-size: 20px; line-height: 1; font-weight: 500; }
.install__done { margin: 0; font-weight: 600; color: var(--accent-text); }

.install__visual { align-self: end; display: flex; justify-content: center; }
.phone {
	width: 236px; height: 250px; padding: 14px 14px 0;
	background: #22262e; border: 7px solid #111318; border-bottom: 0;
	border-radius: 36px 36px 0 0; box-shadow: 0 -4px 30px rgba(0, 0, 0, .18);
}
.phone__time { text-align: center; color: #fff; font: 600 13px/1 var(--font); margin: 4px 0 16px; }
.phone__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 10px; }
.phone__grid i { display: block; aspect-ratio: 1; border-radius: 12px; background: #4a4f59; }
.phone__app { position: relative; display: block; aspect-ratio: 1; }
.phone__app img { display: block; width: 100%; height: 100%; border-radius: 12px; box-shadow: 0 0 0 2px #fff, 0 6px 16px rgba(0, 0, 0, .4); }
.phone__app b { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font: 600 9px/1 var(--font); color: #fff; }

@media (max-width: 760px) {
	.install { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 0; }
	.install__text { padding-bottom: 8px; }
	.install__visual { justify-content: center; }
	.phone { width: 210px; height: 150px; }
}
@media (display-mode: standalone) { .install-wrap { display: none; } }
.install-wrap.is-installed .install__btn { display: none; }

.install-help {
	width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.install-help::backdrop { background: rgba(5, 10, 20, .5); }
.install-help__title { font-size: 19px; margin-bottom: 12px; }
.install-help__steps { margin: 0 0 18px; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.install-help__icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer__in { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.footer__about p { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 320px; }
.footer__col { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.footer__col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.footer__col a { color: var(--text-2); }
.footer__col a:hover { color: var(--accent-text); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.footer__bottom a { color: var(--muted); }
.footer__bottom a:hover { color: var(--accent-text); }
@media (max-width: 760px) { .footer__in { grid-template-columns: 1fr 1fr; } .footer__about { grid-column: 1 / -1; } }

/* ---------- Auth pages (register / lost password) ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px var(--gutter); }
.auth-page__box { width: 100%; max-width: 560px; }
.auth-page__back { font-size: 14px; color: var(--muted); }

/* ---------- Mobile header ---------- */
@media (max-width: 960px) {
	.header__in { gap: 10px; }
	.nav-toggle { display: inline-grid; }
	.nav {
		position: absolute; left: 0; right: 0; top: var(--header-h);
		display: none; flex-direction: column; gap: 2px; padding: 10px var(--gutter) 14px;
		background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
	}
	.nav.is-open { display: flex; }
	.nav__link { padding: 12px; }
	.search { max-width: none; }
}
@media (max-width: 560px) {
	:root { --header-h: 58px; }
	.logo__text { display: none; }
	.user-menu__name { display: none; }
	.user-menu__btn { padding: 0 4px; }
	.section { margin-top: 32px; }
	.tool-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.cat-tile__name { overflow-wrap: anywhere; }
}

/* ---------- DLE system overrides ---------- */
.ui-dialog { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; }
.ui-dialog-titlebar { background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; color: var(--text) !important; }
.ui-widget-overlay { background: rgba(5, 10, 20, .5) !important; }
.highslide-wrapper, .highslide-outline { background: var(--surface); }
#loading-layer { background: var(--surface) !important; color: var(--text) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; }
