/* ============================================================
   أدوات قص تحويل ضغط — Core stylesheet
   Design tokens + shared components. RTL-first, LTR-aware.
   ============================================================ */
:root {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-soft: #f1f5f9;
  --fg: #0f172a;
  --fg-muted: #5b6b82;
  --line: #e3e9f1;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-fg: #ffffff;
  --brand-soft: #e6fffb;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --ring: rgba(15, 118, 110, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px -18px rgba(15, 23, 42, 0.28);
  --header-h: 66px;
  color-scheme: light;
}
html.dark {
  --bg: #070c14;
  --bg-elev: #0e1622;
  --bg-soft: #121c2b;
  --fg: #e8eef7;
  --fg-muted: #9aa9bd;
  --line: #1e2a3b;
  --brand: #2dd4bf;
  --brand-2: #5eead4;
  --brand-fg: #04201d;
  --brand-soft: #0b2b2a;
  --danger: #f87171;
  --danger-soft: #3a1414;
  --success: #4ade80;
  --success-soft: #0d2a17;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Cairo, Tajawal, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[dir="ltr"] body { font-family: Cairo, Tajawal, system-ui, sans-serif; }
h1, h2, h3, h4 { font-family: Tajawal, Cairo, system-ui, sans-serif; line-height: 1.3; margin: 0 0 0.4em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1240px, 100%); margin-inline: auto; padding-inline: 1rem; }
.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: fixed; inset-inline-start: 1rem; top: -60px; z-index: 200;
  background: var(--brand); color: var(--brand-fg); padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ─────────────────────────── Header ─────────────────────────── */
#site-header { position: sticky; top: 0; z-index: 90; }
.site-header {
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
  box-shadow: var(--shadow);
}
.brand__mark svg { width: 24px; height: 24px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: Tajawal, sans-serif; font-weight: 800; font-size: 1.05rem; }
.brand__tag { font-size: 0.72rem; color: var(--fg-muted); }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav__link {
  padding: 0.5rem 0.8rem; border-radius: 10px; color: var(--fg);
  font-weight: 600; font-size: 0.92rem; white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-current="page"] { background: var(--bg-soft); text-decoration: none; color: var(--brand); }
.nav__link.is-active { background: var(--brand-soft); color: var(--brand); }

.nav-drop { position: relative; }
.nav-drop__panel {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0;
  width: min(640px, 92vw); background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem;
  display: none; z-index: 95;
}
.nav-drop[data-open="true"] .nav-drop__panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.nav-drop__group h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--fg-muted); margin: 0 0 0.4rem; display: flex; align-items: center; gap: 0.4rem;
}
.nav-drop__group a {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem;
  border-radius: 9px; color: var(--fg); font-size: 0.9rem;
}
.nav-drop__group a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-drop__group svg { width: 17px; height: 17px; color: var(--brand); flex: 0 0 auto; }

/* search */
.search { position: relative; flex: 1 1 300px; min-width: 230px; max-width: 520px; margin-inline-start: auto; }
.search__box {
  display: flex; align-items: center; gap: 0.5rem; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.85rem;
  min-width: 0;
}
.search__box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.search__box input {
  border: 0; background: transparent; color: var(--fg); width: 100%; min-width: 0;
  outline: none; font-size: 0.92rem; padding: 0.25rem 0;
}
.search__box svg { width: 18px; height: 18px; color: var(--fg-muted); flex: 0 0 auto; }
.search__results {
  position: absolute; inset-inline: 0; top: calc(100% + 8px); background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto; z-index: 95; padding: 0.35rem;
}
.search__results:empty { display: none; }
.search__item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem;
  border-radius: 10px; color: var(--fg);
}
.search__item:hover, .search__item.is-cursor { background: var(--bg-soft); text-decoration: none; }
.search__item small { display: block; color: var(--fg-muted); font-size: 0.75rem; }
.search__item svg { width: 18px; height: 18px; color: var(--brand); flex: 0 0 auto; }
.search__empty { padding: 0.8rem; color: var(--fg-muted); font-size: 0.9rem; text-align: center; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg); cursor: pointer;
  flex: 0 0 auto; transition: 0.15s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--brand); color: var(--brand); }
.icon-btn svg { width: 19px; height: 19px; }
.lang-btn { width: auto; padding: 0 0.7rem; font-weight: 700; font-size: 0.85rem; gap: 0.3rem; }
.nav-toggle { display: none; }

/* ─────────────────────── Privacy banner ─────────────────────── */
.privacy-banner {
  background: linear-gradient(90deg, var(--brand-soft), transparent);
  border-bottom: 1px solid var(--line); font-size: 0.86rem;
}
.privacy-banner__inner {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; color: var(--fg);
}
.privacy-banner svg { width: 18px; height: 18px; color: var(--brand); flex: 0 0 auto; }
.privacy-banner p { margin: 0; flex: 1; }
.privacy-banner button { background: none; border: 0; color: var(--fg-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }

/* ─────────────────────────── Ad slots ─────────────────────────── */
.ad-slot { margin: 1.25rem auto; }
.ad-slot[hidden] { display: none; }
.ad-slot__box {
  border: 1px dashed var(--line); border-radius: var(--radius); background:
    repeating-linear-gradient(45deg, transparent, transparent 12px, color-mix(in srgb, var(--line) 45%, transparent) 12px, color-mix(in srgb, var(--line) 45%, transparent) 13px);
  display: grid; place-items: center; color: var(--fg-muted); text-align: center;
  padding: 0.5rem; overflow: hidden;
}
.ad-slot__label { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.ad-leaderboard .ad-slot__box { min-height: 90px; }
.ad-inline .ad-slot__box { min-height: 74px; }
.ad-native .ad-slot__box { min-height: 120px; }
.ad-slot ins { display: block; width: 100%; }

/* ─────────────────────────── Hero / page heads ─────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; margin: 1.6rem 0;
  padding: clamp(1.6rem, 4vw, 3.4rem);
  background:
    radial-gradient(1100px 500px at 85% -10%, color-mix(in srgb, var(--brand-2) 26%, transparent), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    var(--bg-elev);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem; background: var(--brand-soft);
  color: var(--brand); font-weight: 700; font-size: 0.82rem; padding: 0.35rem 0.8rem;
  border-radius: 999px; margin-bottom: 0.9rem;
}
.hero h1 { font-size: clamp(1.5rem, 4.4vw, 2.7rem); font-weight: 800; max-width: 26ch; }
.hero p.lead { font-size: clamp(1rem, 2vw, 1.12rem); color: var(--fg-muted); max-width: 60ch; }
.hero__search { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1.1rem 0 0.6rem; max-width: 640px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.4rem; }
.hero__stat b { display: block; font-size: 1.35rem; font-family: Tajawal, sans-serif; }
.hero__stat span { color: var(--fg-muted); font-size: 0.85rem; }

.tool-hero {
  display: flex; gap: 1.1rem; align-items: flex-start; margin: 1.2rem 0 1rem;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.tool-hero__icon {
  width: 58px; height: 58px; border-radius: 16px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-hero__icon svg { width: 28px; height: 28px; }
.tool-hero h1 { font-size: clamp(1.3rem, 3.4vw, 2rem); font-weight: 800; }
.tool-hero__intro { color: var(--fg-muted); margin: 0 0 0.7rem; max-width: 80ch; }
.feature-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; }
.feature-chips li {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg-muted);
  font-size: 0.78rem; padding: 0.25rem 0.65rem; border-radius: 999px;
}
.breadcrumbs { font-size: 0.85rem; color: var(--fg-muted); margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.breadcrumbs b { color: var(--fg); }

/* ─────────────────────────── Cards / grid ─────────────────────────── */
.section { margin: 2.4rem 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 800; margin: 0; }
.section__head p { margin: 0; color: var(--fg-muted); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tool-card {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem; color: inherit; display: flex;
  flex-direction: column; gap: 0.5rem; transition: 0.18s; overflow: hidden;
}
.tool-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.tool-card__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-card__icon svg { width: 23px; height: 23px; }
.tool-card h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.tool-card p { margin: 0; color: var(--fg-muted); font-size: 0.88rem; }
.tool-card__go { margin-top: auto; color: var(--brand); font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.tool-card__go::after { content: "←"; }
[dir="ltr"] .tool-card__go::after { content: "→"; }
.tool-card__badge {
  position: absolute; inset-inline-end: 0.9rem; top: 0.9rem; background: var(--warn);
  color: #fff; font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px;
}

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.cat-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; color: inherit; display: flex; flex-direction: column; gap: 0.55rem; transition: 0.18s;
}
.cat-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-card__icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; }
.cat-card__icon svg { width: 26px; height: 26px; }
.cat-card h3 { margin: 0; }
.cat-card p { color: var(--fg-muted); margin: 0; font-size: 0.9rem; }
.cat-card__count { font-size: 0.78rem; color: var(--brand); font-weight: 700; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.why-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.why-card svg { width: 26px; height: 26px; color: var(--brand); margin-bottom: 0.5rem; }
.why-card h3 { font-size: 1rem; margin: 0 0 0.3rem; }
.why-card p { margin: 0; color: var(--fg-muted); font-size: 0.88rem; }

/* ─────────────────────────── Tool UI kit ─────────────────────────── */
.panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.panel--flat { box-shadow: none; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.panel__head h2, .panel__head h3 { margin: 0; font-size: 1.05rem; }
.panel__hint { color: var(--fg-muted); font-size: 0.82rem; margin: 0.2rem 0 0; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft);
  padding: 2rem 1rem; text-align: center; cursor: pointer; transition: 0.18s; color: var(--fg-muted);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone svg { width: 34px; height: 34px; color: var(--brand); margin-bottom: 0.5rem; }
.dropzone b { display: block; color: var(--fg); font-size: 1rem; }
.dropzone span { font-size: 0.82rem; }
.dropzone input[type="file"] { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg);
  padding: 0.6rem 1.1rem; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: 0.15s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--brand); color: var(--brand); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.btn--primary:hover:not(:disabled) { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-fg); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; border-radius: 9px; }
.btn--lg { padding: 0.8rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--block { width: 100%; }

.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.field > label, .label { font-size: 0.84rem; font-weight: 700; color: var(--fg); }
.input, .select, .textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; font: inherit; font-size: 0.9rem;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.hint { font-size: 0.76rem; color: var(--fg-muted); }

.range { width: 100%; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.88rem; }

.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--fg-muted); padding: 0.4rem 0.85rem;
  border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 0.84rem;
}
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-fg); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.6rem; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.65rem 0.75rem; text-align: center; }
.stat b { display: block; font-size: 1.3rem; font-family: Tajawal, sans-serif; }
.stat span { font-size: 0.74rem; color: var(--fg-muted); }

.preview { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem; display: grid; place-items: center; min-height: 160px; overflow: hidden; }
.preview img, .preview canvas { max-height: 380px; width: auto; max-width: 100%; border-radius: 8px; }
.preview--checker { background-image: linear-gradient(45deg, #d7dee8 25%, transparent 25%), linear-gradient(-45deg, #d7dee8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d7dee8 75%), linear-gradient(-45deg, transparent 75%, #d7dee8 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-color: #eef2f7; }

.file-list { list-style: none; margin: 0.8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.file-row {
  display: flex; align-items: center; gap: 0.7rem; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem;
}
.file-row__thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--bg); flex: 0 0 auto; }
.file-row__name { font-weight: 600; font-size: 0.88rem; word-break: break-all; }
.file-row__meta { font-size: 0.75rem; color: var(--fg-muted); }
.file-row__tools { margin-inline-start: auto; display: flex; gap: 0.3rem; flex-shrink: 0; }
.file-row.is-drag { opacity: 0.45; }
.file-row.is-target { border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }
.drag-handle { cursor: grab; color: var(--fg-muted); background: none; border: 0; padding: 0.2rem; }
.drag-handle svg { width: 18px; height: 18px; }

.progress { height: 9px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.25s; }

.toast-wrap { position: fixed; inset-block-end: 1rem; inset-inline-end: 1rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; max-width: 90vw; }
.toast {
  background: var(--bg-elev); border: 1px solid var(--line); border-inline-start: 4px solid var(--brand);
  border-radius: 12px; padding: 0.65rem 0.9rem; box-shadow: var(--shadow); font-size: 0.88rem;
  display: flex; align-items: center; gap: 0.5rem; animation: toast-in 0.25s ease;
}
.toast--error { border-inline-start-color: var(--danger); }
.toast--success { border-inline-start-color: var(--success); }
.toast--warn { border-inline-start-color: var(--warn); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line);
  border-top-color: var(--brand); animation: spin 0.7s linear infinite; display: inline-block;
}
.spinner--lg { width: 34px; height: 34px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.8rem; color: var(--fg-muted); font-size: 0.9rem;
}

.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 0.9rem; overflow-x: auto; }
.tab {
  border: 0; background: none; color: var(--fg-muted); padding: 0.6rem 0.9rem;
  cursor: pointer; font-weight: 700; font-size: 0.9rem; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel[hidden] { display: none; }

.badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg-muted); }
.badge--ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); border-color: transparent; }

.note { font-size: 0.84rem; color: var(--fg-muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
.note--warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.note--danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.tool-about { margin: 2rem 0; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.tool-about h2 { font-size: 1.15rem; }
.tool-about p { color: var(--fg-muted); }

/* diff viewer */
.diff-pane { font-family: "Cairo", monospace; font-size: 0.86rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem; min-height: 200px; max-height: 60vh; overflow: auto; }
.diff-pane .add { background: var(--success-soft); color: var(--success); display: block; }
.diff-pane .del { background: var(--danger-soft); color: var(--danger); display: block; text-decoration: line-through; }
.diff-pane .same { color: var(--fg-muted); display: block; }

/* qr / canvas outputs */
.canvas-wrap { display: grid; place-items: center; padding: 1rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.canvas-wrap canvas, .canvas-wrap img, .canvas-wrap svg { max-width: 100%; height: auto; }
.checker { background: repeating-conic-gradient(#e9eef5 0% 25%, #ffffff 0% 50%) 50% / 18px 18px; }
html.dark .checker { background: repeating-conic-gradient(#16202e 0% 25%, #0e1622 0% 50%) 50% / 18px 18px; }

.meter { height: 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; transition: 0.25s; }
.meter--weak > i { background: var(--danger); }
.meter--fair > i { background: var(--warn); }
.meter--good > i { background: #0ea5e9; }
.meter--strong > i { background: var(--success); }

.kbd { font: 600 0.75rem/1 monospace; background: var(--bg-soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0.15rem 0.4rem; }

.result-block { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem; font-family: ui-monospace, monospace; font-size: 0.85rem; word-break: break-all; }
.copy-row { display: flex; gap: 0.5rem; align-items: center; }
.copy-row .result-block { flex: 1; }

/* ─────────────── Audio equalizer (voice recorder) ─────────────── */
.eq-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.9rem; }
.eq-presets button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.eq-wrap { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 1rem; align-items: stretch; }
.eq-bands {
  display: flex; justify-content: space-around; gap: 0.4rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.8rem 0.5rem;
}
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; flex: 1; }
.eq-band .eq-val {
  font-weight: 700; font-size: 0.78rem; min-width: 2.4em; text-align: center;
  color: var(--brand); border: 1px solid var(--line); border-radius: 6px; padding: 0.05rem 0.2rem; background: var(--bg-elev);
}
.eq-band .eq-slider {
  writing-mode: vertical-lr; direction: rtl;
  width: 26px; height: 150px; accent-color: var(--brand); cursor: pointer;
}
.eq-band .eq-name { font-size: 0.75rem; font-weight: 700; text-align: center; display: flex; flex-direction: column; line-height: 1.25; }
.eq-band .eq-name small { font-weight: 400; color: var(--fg-muted); font-size: 0.65rem; }
.eq-curve { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.4rem; display: grid; place-items: center; min-height: 190px; }
.eq-curve canvas { width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 720px) {
  .eq-wrap { grid-template-columns: 1fr; }
  .eq-band .eq-slider { height: 120px; }
}

/* ─────────────────────────── Footer ─────────────────────────── */
.site-footer { margin-top: 3rem; background: var(--bg-elev); border-top: 1px solid var(--line); }
.site-footer__inner { padding: 2.2rem 0 1.2rem; display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 1.6rem; }
.footer-brand p { color: var(--fg-muted); font-size: 0.88rem; max-width: 40ch; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 0.6rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.footer-col a { color: var(--fg-muted); font-size: 0.86rem; }
.footer-col a:hover { color: var(--brand); }
.footer-seo { border-top: 1px solid var(--line); padding: 0.9rem 0; font-size: 0.78rem; color: var(--fg-muted); line-height: 1.9; }
.footer-bottom { border-top: 1px solid var(--line); padding: 0.9rem 0; display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--fg-muted); }

/* ─────────────────────────── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1500px) {
  .nav .desktop-only { display: none; }
}
@media (max-width: 860px) {
  .nav { gap: 0.15rem; }
  .nav .desktop-only { display: none; }
  .nav-toggle { display: grid; }
  .search { order: 10; flex-basis: 100%; max-width: none; }
  .site-header__inner { flex-wrap: wrap; padding-bottom: 0.6rem; }
  .mobile-drawer { position: fixed; inset: 0; z-index: 120; background: color-mix(in srgb, #000 45%, transparent); display: none; }
  .mobile-drawer[data-open="true"] { display: block; }
  .mobile-drawer__panel { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(340px, 88vw); background: var(--bg-elev); border-inline-start: 1px solid var(--line); overflow: auto; padding: 1rem; }
  .mobile-drawer h4 { margin: 0.9rem 0 0.4rem; font-size: 0.8rem; text-transform: uppercase; color: var(--fg-muted); }
  .mobile-drawer a { display: block; padding: 0.55rem 0.6rem; border-radius: 9px; color: var(--fg); }
  .mobile-drawer a:hover { background: var(--bg-soft); text-decoration: none; }
}
@media (min-width: 861px) { .mobile-drawer { display: none !important; } }
@media (max-width: 560px) {
  .site-footer__inner { grid-template-columns: 1fr; }
  .tool-hero { flex-direction: column; }
  .hero { border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media print {
  #site-header, #site-footer, .ad-slot, #privacy-banner, .no-print { display: none !important; }
}
