/* TOOLORA public stylesheet. Uses CSS logical properties so RTL and LTR share one set of rules. */
@font-face { font-family: "Plex Arabic"; src: url("/assets/fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/fonts/plex-arabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/fonts/plex-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --ink: #142019;
  --ink-2: #4a5a50;
  --muted: #6b7a70;
  --line: #dde3dc;
  --brand: #0b6e5f;
  --brand-ink: #ffffff;
  --brand-soft: #e1f2ee;
  --accent: #ffb020;
  --danger: #c2372b;
  --success: #1c7c4a;
  --warn: #9a6400;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 25, .05), 0 6px 20px rgba(20, 32, 25, .06);
  --shadow-lg: 0 18px 50px rgba(20, 32, 25, .12);
  --c-pdf: #d6453d; --c-image: #7a4fd6; --c-qr: #1d7fd1; --c-text: #0b6e5f; --c-calc: #d9822b; --c-code: #2f5f9e; --c-clock: #b8457e;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-ar: "Plex Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e1411; --surface: #151d19; --surface-2: #1c2621; --ink: #e9efe9; --ink-2: #b8c4bc; --muted: #8d9a91; --line: #2a362f; --brand: #35b39b; --brand-ink: #062019; --brand-soft: #173a32; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 18px 50px rgba(0,0,0,.45); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0e1411; --surface: #151d19; --surface-2: #1c2621; --ink: #e9efe9; --ink-2: #b8c4bc; --muted: #8d9a91; --line: #2a362f; --brand: #35b39b; --brand-ink: #062019; --brand-soft: #173a32; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 18px 50px rgba(0,0,0,.45); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font); text-rendering: optimizeLegibility; }
html[dir="rtl"] body, .lang-ar, .lang-fa, .lang-ur { font-family: var(--font-ar); }
html[dir="rtl"] body { line-height: 1.8; }
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; letter-spacing: -.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; }
h3, .h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; inset-block-start: -3rem; background: var(--brand); color: var(--brand-ink); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { inset-block-start: 1rem; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -.25em; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
html[dir="ltr"] .flip-ltr { transform: scaleX(-1); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2rem); }
.page { padding-block: 1.5rem 3rem; }

/* Header */
.site-header { position: sticky; inset-block-start: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-block-end: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: .04em; }
.brand-mark { color: var(--brand); display: inline-flex; }
.brand-name { font-size: 1.15rem; font-family: var(--font); }
.main-nav { margin-inline-end: auto; min-width: 0; overflow: hidden; }
.main-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .94rem; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: .4rem; }
.header-search { position: relative; display: flex; align-items: center; gap: .4rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding-inline: .8rem; height: 40px; color: var(--muted); }
.header-search input[type="search"] { border: 0; background: transparent; outline: none; box-shadow: none; width: 10rem; min-height: 0; padding: 0; color: var(--ink); }
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; height: 40px; min-width: 40px; justify-content: center; padding-inline: .6rem; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.btn-icon:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.lang-switch { position: relative; }
.lang-current { font-size: .9rem; }
.lang-menu { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: .35rem; min-width: 190px; max-height: 70vh; overflow: auto; z-index: 50; }
.lang-menu a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--brand-soft); }
.badge-default { font-size: .7rem; color: var(--brand); border: 1px solid currentColor; border-radius: 99px; padding: 0 .4rem; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.nav-toggle { display: none; }

@media (min-width: 1081px) and (max-width: 1380px) { .main-nav .nav-cat:nth-child(n+5) { display: none; } }
@media (min-width: 1081px) and (max-width: 1220px) { .main-nav .nav-cat:nth-child(n+4) { display: none; } }

/* Autocomplete */
.ac-list { position: absolute; inset-inline: 0; inset-block-start: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; padding: .3rem; text-align: start; min-width: 260px; }
.ac-list a { display: block; padding: .5rem .7rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.ac-list a small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-list a:hover, .ac-list a[aria-selected="true"] { background: var(--brand-soft); }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .5rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: .3rem .75rem; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.form .field { margin-block-end: 1rem; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin-block-end: .35rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="url"], input[type="tel"], input[type="password"], input[type="date"], input[type="time"], input[type="datetime-local"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; vertical-align: -.15em; }
input[type="color"] { width: 52px; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.field-error { color: var(--danger); font-size: .85rem; margin: .3rem 0 0; }
.has-error input, .has-error textarea { border-color: var(--danger); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-block-end: 1rem; border: 1px solid; }
.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); }
.alert-error { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.alert-warn { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--ink); }

/* Hero */
.hero { background: radial-gradient(1200px 380px at 50% -80px, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), linear-gradient(var(--bg), var(--bg)); padding-block: clamp(2.5rem, 7vw, 5rem) 2.5rem; text-align: center; }
.hero-inner { max-width: 820px; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); padding: .3rem .85rem; border-radius: 99px; color: var(--ink-2); font-size: .88rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-block: 1rem .6rem; }
.hero-sub { color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 640px; margin-inline: auto; }
.hero-search { position: relative; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .4rem; padding-inline-start: 1rem; box-shadow: var(--shadow-lg); margin: 1.6rem auto 1rem; max-width: 640px; color: var(--muted); }
.hero-search input { flex: 1; border: 0 !important; box-shadow: none !important; background: transparent; min-height: 46px; font-size: 1.05rem; padding-inline: .2rem; }
.hero-search.compact { box-shadow: var(--shadow); margin-inline: 0; }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; list-style: none; padding: 0; margin: 0; color: var(--ink-2); font-size: .92rem; }
.hero-points li { display: inline-flex; align-items: center; gap: .35rem; }
.hero-points .icon { color: var(--brand); }

/* Sections & grids */
.section { margin-block: 2.5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: 1rem; }
.section-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.section-head h2 a { color: inherit; text-decoration: none; }
.section-head .icon { color: var(--brand); }
.more { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 600; font-size: .94rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
@media (min-width: 1100px) { .cat-grid { grid-template-columns: repeat(7, 1fr); } }
.cat-card { --c: var(--brand); display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.cat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--c); }
.cat-icon.lg { width: 60px; height: 60px; border-radius: 16px; }
.cat-icon.lg .icon { width: 30px; height: 30px; }
.cat-name { font-weight: 700; }
.cat-count { color: var(--muted); font-size: .85rem; }
.cat-pdf-tools { --c: var(--c-pdf); } .cat-image-tools { --c: var(--c-image); } .cat-qr-code-tools { --c: var(--c-qr); } .cat-text-tools { --c: var(--c-text); } .cat-calculators { --c: var(--c-calc); } .cat-developer-tools { --c: var(--c-code); } .cat-time-and-utilities { --c: var(--c-clock); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.tool-card { --c: var(--brand); display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 92px; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.tool-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--c); flex-shrink: 0; }
.tool-icon.lg { width: 56px; height: 56px; border-radius: 15px; }
.tool-icon.lg .icon { width: 28px; height: 28px; }
.tool-body { display: flex; flex-direction: column; min-width: 0; }
.tool-name { font-weight: 700; }
.tool-desc { color: var(--muted); font-size: .88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; }
.chip:hover { border-color: var(--brand); }
.why { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.25rem, 3vw, 2rem); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.why-grid .icon { width: 30px; height: 30px; color: var(--brand); }
.why-grid h3 { margin-block: .6rem .3rem; }
.why-grid p { color: var(--ink-2); margin: 0; }

/* Page heads & breadcrumbs */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .88rem; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline-start: .3rem; opacity: .6; }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.page-head { margin-block-end: 1.5rem; }
.page-head .lead, .lead { color: var(--ink-2); font-size: 1.05rem; }
.cat-head, .tool-head { display: flex; gap: 1rem; align-items: flex-start; }
.cat-head h1, .tool-head h1 { margin-block-end: .25rem; }
.filter-box { display: flex; align-items: center; gap: .5rem; max-width: 420px; color: var(--muted); }

/* Tool page */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1rem, 2.5vw, 1.6rem); box-shadow: var(--shadow); margin-block: 1.25rem; }
.tool-loading { display: grid; place-items: center; min-height: 160px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-block-start-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.privacy-note { display: flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .85rem; margin: 1rem 0 0; }
.privacy-note .icon { color: var(--success); }
.tool-aside { position: sticky; inset-block-start: 84px; display: flex; flex-direction: column; gap: 1.25rem; }
.tool-list { display: flex; flex-direction: column; gap: .6rem; }
.tool-list .tool-card { min-height: 0; padding: .75rem; }
.tool-list .tool-icon { width: 36px; height: 36px; }
.howto, .faq, .tool-about { margin-block: 2rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.steps li { counter-increment: s; position: relative; padding: .75rem 1rem; padding-inline-start: 3.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: .8rem; inset-block-start: .7rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .9rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-block-end: .6rem; }
.faq summary { cursor: pointer; padding: .85rem 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 1rem 1rem; margin: 0; color: var(--ink-2); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block: 2rem; color: var(--muted); }

/* Tool UI building blocks (used by engines) */
.tw { display: grid; gap: 1rem; }
.tw-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.tw-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tw-output { position: relative; }
.tw-output textarea, .tw-mono, textarea.mono { font-family: var(--mono); font-size: .9rem; direction: ltr; text-align: left; }
.tw-result { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; }
.tw-result.big { text-align: center; }
.tw-big { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; color: var(--brand); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.tw-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; }
.tw-stat b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.tw-stat span { color: var(--muted); font-size: .85rem; }
.tw-stat.hl { border-color: var(--brand); background: var(--brand-soft); }
.tw-stat.hl b { color: var(--brand); }
.tw-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tw-table th, .tw-table td { padding: .55rem .7rem; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; }
.tw-table th { color: var(--muted); font-weight: 600; width: 40%; }
.tw-table td.num, .num { font-variant-numeric: tabular-nums; }
.tw-table-wrap { overflow-x: auto; }
.dropzone { display: grid; place-items: center; gap: .5rem; text-align: center; padding: 2rem 1rem; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; color: var(--ink-2); }
.dropzone .icon { width: 38px; height: 38px; color: var(--brand); }
.dropzone.drag, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { color: var(--ink); }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.file-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.file-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.file-item .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.file-item button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-width: 32px; height: 32px; cursor: pointer; }
.preview { display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0/20px 20px; border: 1px solid var(--line); border-radius: 14px; padding: .75rem; min-height: 140px; overflow: auto; }
.preview img, .preview canvas { max-height: 480px; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.thumb { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem; text-align: center; font-size: .82rem; color: var(--muted); }
.thumb img, .thumb canvas { display: block; width: 100%; height: 160px; object-fit: contain; margin-block-end: .4rem; background: #fff; border-radius: 6px; }
.thumb.sel { outline: 3px solid var(--brand); }
.qr-out { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.qr-out .qr-box { background: #fff; padding: .75rem; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; }
.qr-out canvas { width: 240px; height: 240px; image-rendering: pixelated; }
.inline-check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: .5rem .9rem; cursor: pointer; color: var(--ink-2); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.diff-out { font-family: var(--mono); font-size: .88rem; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; direction: ltr; text-align: left; unicode-bidi: plaintext; max-height: 480px; overflow: auto; }
.diff-out .add { background: color-mix(in srgb, var(--success) 18%, transparent); display: block; }
.diff-out .del { background: color-mix(in srgb, var(--danger) 16%, transparent); display: block; text-decoration: line-through; }
.mark { background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 3px; }
.clock-face { font-size: clamp(2.6rem, 9vw, 4.6rem); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; letter-spacing: .02em; direction: ltr; }
.laps { max-height: 260px; overflow: auto; }
.swatch { width: 100%; height: 72px; border-radius: 12px; border: 1px solid var(--line); }
.crop-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 520px; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; }
.crop-box .h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; inset-inline-end: -8px; inset-block-end: -8px; cursor: nwse-resize; }
.picker-canvas { cursor: crosshair; max-width: 100%; border-radius: 10px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
[dir="rtl"] .progress > span { margin-inline-start: auto; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.tw-help { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }

/* Prose */
.prose { font-size: 1.02rem; }
.prose h2 { margin-block-start: 1.8em; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin-block: .3rem; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5rem; }
.prose blockquote { margin: 1rem 0; padding: .5rem 1rem; border-inline-start: 4px solid var(--brand); background: var(--surface-2); border-radius: 8px; }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.post-hero { border-radius: 16px; margin-block: 1rem; }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.post-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-thumb { aspect-ratio: 16/9; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.post-thumb .icon { width: 40px; height: 40px; }
.post-body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; }
.post-cat { color: var(--brand); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.post-title { font-weight: 700; font-size: 1.08rem; }
.post-excerpt { color: var(--ink-2); font-size: .92rem; }
.post-card time { color: var(--muted); font-size: .82rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-block: 2rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Error page */
.error-page { text-align: center; padding-block: 4rem; }
.error-code { font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; color: var(--brand); margin: 0; line-height: 1; font-family: var(--font); }
.error-actions { display: flex; justify-content: center; gap: .6rem; margin-block: 1.5rem; flex-wrap: wrap; }
.error-page .hero-search { margin-inline: auto; }
.debug { text-align: start; direction: ltr; white-space: pre-wrap; background: var(--surface-2); padding: 1rem; border-radius: 10px; font-size: .8rem; overflow: auto; }

/* Ads: reserved space limits layout shift; label makes ads clearly identifiable. */
.ad-slot { display: block; margin: 1.25rem auto; min-height: 100px; max-width: 100%; text-align: center; overflow: hidden; }
.ad-slot:empty, .ad-slot:not(.ad-on) { display: none; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-block-end: .25rem; }
.tool-aside .ad-slot { min-height: 250px; }
@media (max-width: 760px) { .ad-desktop-only { display: none !important; } }
@media (min-width: 761px) { .ad-mobile-only { display: none !important; } }

/* Footer */
.site-footer { background: var(--surface); border-block-start: 1px solid var(--line); margin-block-start: 3rem; padding-block: 2.5rem 1.25rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); }
.footer-about p { color: var(--ink-2); margin-block-start: .6rem; max-width: 34ch; }
.footer-title { font-size: .95rem; margin-block-end: .8rem; }
.footer-langs { grid-template-columns: 1fr 1fr; }
.socials { display: flex !important; gap: .8rem !important; flex-wrap: wrap; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-block-start: 1px solid var(--line); margin-block-start: 2rem; padding-block-start: 1.25rem; font-size: .85rem; color: var(--muted); }
.footer-bottom p { margin: 0; }

/* Consent & toast */
.consent { position: fixed; inset-inline: 1rem; inset-block-end: 1rem; z-index: 80; display: flex; justify-content: center; }
.consent[hidden] { display: none; }
.consent-inner { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 1rem 1.2rem; max-width: 720px; width: 100%; }
.consent-title { font-weight: 700; margin-block-end: .3rem; }
.consent-inner p { margin-block-end: .6rem; font-size: .92rem; color: var(--ink-2); }
.consent-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.toast { position: fixed; inset-block-end: 1.25rem; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border-radius: 10px; z-index: 90; box-shadow: var(--shadow-lg); font-size: .92rem; }
[dir="rtl"] .toast { transform: translateX(50%); }

/* Responsive */
@media (max-width: 1080px) {
  .main-nav { position: fixed; inset: 64px 0 auto 0; background: var(--surface); border-block-end: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: .75rem 1rem; display: none; max-height: calc(100vh - 64px); overflow: auto; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: .7rem .8rem; }
  .nav-toggle { display: inline-flex; }
  .header-actions { margin-inline-start: auto; }
}
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-search { display: none; }
  .lang-current { display: none; }
  .form-row.two { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .qr-out { grid-template-columns: 1fr; justify-items: center; }
  .hero-search .btn { padding-inline: .8rem; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-head, .cat-head { flex-direction: column; gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .ad-slot, .consent, .tool-aside, .share { display: none !important; } }
