/* PixelTidy public styles. Light theme by default; dark theme via [data-theme="dark"]. RTL-safe (logical properties). */
:root {
  --bg: #f6f7fb;
  --bg-2: #eef0fb;
  --surface: #ffffff;
  --text: #121527;
  --muted: #5d6478;
  --line: #e3e6f0;
  --brand: #4f46e5;
  --brand-2: #9333ea;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --ok: #0f8a4b;
  --err: #c0262d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 21, 39, .05), 0 6px 24px -10px rgba(18, 21, 39, .14);
  --font-lang: system-ui;
  --font: var(--font-lang), "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0f17;
  --bg-2: #141726;
  --surface: #161a28;
  --text: #e9ebf5;
  --muted: #a2a8bd;
  --line: #262b3d;
  --brand: #8b85ff;
  --brand-2: #c084fc;
  --brand-ink: #0d0f17;
  --brand-soft: #1e2140;
  --ok: #46d08f;
  --err: #ff7d82;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
[dir="rtl"] body { line-height: 1.8; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-lg { width: 40px; height: 40px; }
[dir="rtl"] .ic-flip { transform: scaleX(-1); }

/* Header */
.hdr { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 12px 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand .logo { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a.nav-all { color: var(--brand); }
.hdr-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--brand); }
.ic-sun { display: none; }
[data-theme="dark"] .ic-sun { display: block; }
[data-theme="dark"] .ic-moon { display: none; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding-inline: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .85rem; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 170px; z-index: 30; }
.lang-menu a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text); text-decoration: none; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 720px) {
  .hdr-in { padding-block: 8px; }
  .nav { order: 3; flex-basis: 100%; margin-inline: -8px; padding-bottom: 4px; }
}

main { flex: 1; padding-block: 28px 56px; }

/* Hero */
.hero { position: relative; text-align: center; padding: 48px 20px 36px; margin-bottom: 28px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(1200px 400px at 10% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
              radial-gradient(900px 380px at 110% 10%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 3.1rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 auto 12px; max-width: 820px;
  background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--brand) 75%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
[dir="rtl"] .hero h1 { line-height: 1.35; letter-spacing: 0; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 720px; margin: 0 0 18px; }
.hero .lead { margin-inline: auto; }
.search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 8px auto 0; padding: 0 16px; height: 54px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); color: var(--muted); }
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--text); min-width: 0; }
.page-head .search { margin-inline: 0; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; list-style: none; padding: 0; margin: 22px 0 0; color: var(--muted); font-size: .92rem; font-weight: 600; }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust .ic { color: var(--ok); width: 18px; height: 18px; }

/* Directory */
.dir { columns: 3 300px; column-gap: 16px; }
.cat { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.cat-h { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; margin: 0 0 14px; }
.cat-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; color: var(--cat, var(--brand)); background: color-mix(in srgb, var(--cat, var(--brand)) 14%, transparent); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; line-height: 1.3; transition: border-color .15s, background .15s, color .15s; }
.pill:hover { border-color: var(--cat, var(--brand)); color: var(--cat, var(--brand)); background: color-mix(in srgb, var(--cat, var(--brand)) 8%, var(--surface)); }
.pill-main { font-weight: 700; border-color: color-mix(in srgb, var(--cat, var(--brand)) 35%, var(--line)); }
.pill-more { color: var(--muted); border-style: dashed; }
.pill .ic { width: 15px; height: 15px; }
.related .pills .pill { background: var(--surface); }
.no-results { text-align: center; color: var(--muted); padding: 24px; }

/* Page */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); line-height: 1.18; letter-spacing: -.015em; margin: 0 0 10px; }
[dir="rtl"] .page-head h1 { letter-spacing: 0; line-height: 1.4; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.big-num { font-size: 4.5rem; font-weight: 800; margin: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.content { display: grid; gap: 28px; margin-top: 32px; }
@media (min-width: 960px) { .content { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } }
.prose { max-width: 740px; }
.prose h2 { font-size: 1.35rem; margin: 30px 0 10px; line-height: 1.3; }
.prose h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 22px; }
.prose code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.home-prose { margin: 40px auto 0; }
.faq h2, .related h2 { font-size: 1.25rem; margin: 0 0 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.related { margin-top: 36px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; padding: 10px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; line-height: 1.2; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.sm { padding: 7px 13px; font-size: .9rem; border-radius: 10px; }

/* Tool */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); min-height: 240px; }
.tool-loading { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--muted); }
.dz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 18px; padding: 40px 16px; text-align: center; cursor: pointer;
  background: color-mix(in srgb, var(--brand) 4%, var(--surface)); transition: border-color .15s, background .15s; }
.dz:hover, .dz:focus-visible, .dz.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); outline: none; }
.dz-icon { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); margin-bottom: 6px; }
.dz-icon .ic { width: 28px; height: 28px; }
.dz-title { font-size: 1.15rem; font-weight: 750; margin: 0; }
.dz-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 18px; margin: 16px 0 6px; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt > label, .opt .lbl { font-size: .85rem; color: var(--muted); font-weight: 650; }
.opt input[type=number], .opt select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; width: 100%; min-height: 44px; }
.opt input[type=color] { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 4px; }
.opt input[type=range] { width: 100%; accent-color: var(--brand); min-height: 32px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin: 16px 0 10px; }
.bar .sum { font-weight: 700; }
.bar .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--line); flex: none; }
.meta { flex: 1; min-width: 160px; }
.name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.badge { display: inline-block; margin-inline-start: 4px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--bg-2); color: var(--muted); }
.badge.good { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.stat .bad { color: var(--err); font-weight: 600; }
.x { border: 0; background: transparent; color: var(--muted); font-size: 1.35rem; line-height: 1; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.x:hover { color: var(--text); background: var(--bg-2); }
.info { flex-basis: 100%; }
.info:empty { display: none; }
.info table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); border-radius: 10px; overflow: hidden; }
.info th, .info td { text-align: start; padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.info th { color: var(--muted); font-weight: 600; width: 40%; }
.err { color: var(--err); font-weight: 600; margin: 10px 0 0; }
.ad { margin: 32px 0; text-align: center; overflow: hidden; }
.ad-label { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7280); }
.ad ins.adsbygoogle { min-height: 250px; }
.tool + .ad { margin-top: 48px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }

/* Footer */
.ftr { border-top: 1px solid var(--line); background: var(--surface); padding-block: 32px; font-size: .92rem; color: var(--muted); }
.ftr-in { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ftr-in { grid-template-columns: 1.2fr 1fr; } .ftr-copy { grid-column: 1 / -1; } }
.ftr-brand p { margin: 8px 0 0; max-width: 420px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: start; }
.ftr-links a { color: var(--muted); text-decoration: none; }
.ftr-links a:hover { color: var(--brand); }
.ftr-copy { margin: 0; border-top: 1px solid var(--line); padding-top: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .hdr, .ftr, .ad, .tool, .related { display: none; } body { background: #fff; } }
