/* ============================================================
   أدوات قص تحويل ضغط — 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);
  -webkit-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__close-btn { display: none; }
.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; }

.header-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.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; }
.search-toggle-btn { display: none; }
.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-wrap {
  position: relative; flex: 0 0 auto;
}
.tool-hero__icon {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-hero__icon svg { width: 28px; height: 28px; }
.tool-hero__avatar-btn {
  position: absolute; inset-inline-end: -6px; bottom: -6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 2px solid var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 3; padding: 0;
}
.tool-hero__avatar-btn:hover { transform: scale(1.15); background: #0d9488; }
.tool-hero__avatar-btn svg { width: 14px; height: 14px; stroke-width: 2.4; }

.tool-hero__body { flex: 1; min-width: 0; }
.tool-hero__head-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem;
  flex-wrap: wrap; margin-bottom: 0.35rem;
}
.tool-hero__head-row h1 { margin: 0; }
.tool-hero__install-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.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.55rem; transition: 0.18s; overflow: visible;
}
.tool-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.tool-card__head {
  display: flex; align-items: center; justify-content: space-between; position: relative;
}
.tool-card__icon-wrap {
  position: relative; display: inline-block; width: fit-content;
}
.tool-card__icon {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-card__icon svg { width: 24px; height: 24px; }
.tool-avatar-install-btn {
  position: absolute; inset-inline-end: -6px; bottom: -6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 2px solid var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 3; padding: 0;
}
.tool-avatar-install-btn:hover {
  transform: scale(1.18); background: #0d9488;
}
.tool-avatar-install-btn svg { width: 12px; height: 12px; stroke-width: 2.4; }

.tool-card__content {
  display: flex; flex-direction: column; gap: 0.35rem; color: inherit; text-decoration: none; flex: 1;
}
.tool-card__content:hover { text-decoration: none; }
.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; line-height: 1.5; }

.tool-card__actions {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.6rem; border-top: 1px solid var(--line);
}
.tool-card__go { 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__install-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  border: 1px solid transparent; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  transition: all 0.15s ease;
}
.tool-card__install-btn:hover { background: var(--brand); color: #fff; }
.tool-card__install-btn svg { width: 13px; height: 13px; }

.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) {
  :root { --header-h: 52px; }
  #site-header {
    position: sticky; top: 0; z-index: 90; width: 100%;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  }
  #site-header.is-hidden {
    transform: translateY(-100%);
  }
  .site-header {
    height: var(--header-h);
    min-height: var(--header-h);
    border-bottom: 1px solid var(--line);
  }
  .site-header__inner {
    height: var(--header-h);
    min-height: var(--header-h);
    padding-block: 0;
    padding-inline: clamp(0.5rem, 2.5vw, 1rem);
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: space-between;
  }
  .brand {
    gap: 0.45rem;
    flex: 0 1 auto;
    min-width: 0;
  }
  .brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .brand__mark svg {
    width: 18px;
    height: 18px;
  }
  .brand__name {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand__tag {
    display: none !important;
  }
  .nav {
    display: none !important;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-inline-start: auto;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .icon-btn svg {
    width: 17px;
    height: 17px;
  }
  .lang-btn {
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.78rem;
  }
  .search-toggle-btn {
    display: grid !important;
    place-items: center;
  }
  .nav-toggle {
    display: grid !important;
    place-items: center;
  }
  .search {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: var(--header-h);
    z-index: 100;
    background: var(--bg-elev);
    padding: 0.35rem 0.65rem;
    margin: 0;
    max-width: 100%;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    align-items: center;
  }
  .search.is-open {
    display: flex !important;
  }
  .search__box {
    width: 100%;
    padding: 0.3rem 0.65rem;
    border-radius: 9px;
  }
  .search__box .kbd {
    display: none !important;
  }
  .search__close-btn {
    display: grid !important;
    place-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    color: var(--fg-muted);
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    margin-inline-start: 0.25rem;
  }
  .search__close-btn svg {
    width: 18px;
    height: 18px;
  }
  .search__results {
    position: absolute;
    inset-inline: 0.5rem;
    top: calc(100% + 6px);
    max-height: calc(85vh - 60px);
    border-radius: 12px;
  }

  /* Mobile drawer */
  .mobile-drawer {
    position: fixed; inset: 0; z-index: 200;
    display: flex; justify-content: flex-end;
    visibility: hidden; opacity: 0;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }
  .mobile-drawer[data-open="true"] {
    visibility: visible; opacity: 1;
  }
  .mobile-drawer__backdrop {
    position: absolute; inset: 0;
    background: color-mix(in srgb, #000 50%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .mobile-drawer__panel {
    position: relative; width: min(340px, 86vw); height: 100%;
    background: var(--bg-elev); border-inline-start: 1px solid var(--line);
    display: flex; flex-direction: column; z-index: 2;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
  }
  [dir="rtl"] .mobile-drawer__panel {
    transform: translateX(-100%);
  }
  .mobile-drawer[data-open="true"] .mobile-drawer__panel {
    transform: translateX(0);
  }
  .mobile-drawer__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); min-height: 52px;
  }
  .mobile-drawer__body {
    flex: 1; overflow-y: auto; padding: 0.8rem 0.9rem;
    display: flex; flex-direction: column; gap: 0.6rem;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-drawer__link--main {
    display: flex; align-items: center; gap: 0.55rem; font-weight: 700;
    font-size: 0.92rem; background: var(--brand-soft); color: var(--brand) !important;
    border-radius: 10px; padding: 0.6rem 0.8rem !important;
  }
  .mobile-drawer__section-title {
    display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; color: var(--fg-muted); margin-top: 0.3rem;
  }
  .mobile-drawer__cat {
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  }
  .mobile-drawer__cat-title {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
    font-weight: 700; font-size: 0.84rem; color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 40%, var(--bg-soft));
    border-bottom: 1px solid var(--line);
  }
  .mobile-drawer__cat-links { display: flex; flex-direction: column; padding: 0.25rem; }
  .mobile-drawer__link {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.42rem 0.6rem;
    border-radius: 7px; color: var(--fg); font-size: 0.86rem;
  }
  .mobile-drawer__link:hover { background: var(--bg-elev); color: var(--brand); text-decoration: none; }
  .mobile-drawer__link svg { width: 15px; height: 15px; color: var(--brand); flex-shrink: 0; }
  .mobile-drawer__footer {
    display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--line); background: var(--bg-soft);
  }
  body.drawer-open {
    overflow: hidden;
  }
}
@media (min-width: 861px) { .mobile-drawer { display: none !important; } }

@media (max-width: 640px) {
  .hero { border-radius: 18px; margin: 1rem 0; padding: 1.25rem 0.95rem; }
  .hero h1 { font-size: 1.45rem; line-height: 1.3; }
  .hero p.lead { font-size: 0.92rem; }
  .hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.9rem; }
  .hero__stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem; }
  .hero__stat b { font-size: 1.15rem; }
  .tool-hero { flex-direction: column; align-items: flex-start; gap: 0.7rem; padding: 0.95rem; border-radius: 14px; margin: 0.8rem 0; }
  .tool-hero__icon { width: 44px; height: 44px; border-radius: 12px; }
  .tool-hero__icon svg { width: 22px; height: 22px; }
  .tool-hero h1 { font-size: 1.25rem; margin-bottom: 0.2rem; }
  .tool-hero__intro { font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.4rem; }
  .feature-chips { gap: 0.35rem; }
  .feature-chips li { font-size: 0.72rem; padding: 0.2rem 0.55rem; }
  .panel { padding: 0.85rem; border-radius: 12px; margin-bottom: 0.8rem; }
  .dropzone { padding: 1.35rem 0.75rem; border-radius: 12px; }
  .dropzone svg { width: 28px; height: 28px; }
  .dropzone b { font-size: 0.92rem; }
  .dropzone span { font-size: 0.76rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 0.8rem; }
  .grid-3 { grid-template-columns: 1fr; gap: 0.65rem; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0.8rem; }
  .cat-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .why-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .btn { padding: 0.55rem 0.9rem; font-size: 0.86rem; border-radius: 10px; min-height: 40px; }
  .row { gap: 0.4rem; }
  .field { margin-bottom: 0.55rem; }
  .input, .select, .textarea { padding: 0.5rem 0.65rem; font-size: 0.88rem; }
  .privacy-banner { font-size: 0.78rem; }
  .privacy-banner__inner { padding: 0.35rem 0; gap: 0.4rem; }
  .privacy-banner svg { width: 15px; height: 15px; }
  .site-footer { margin-top: 2rem; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.5rem 0 1rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 360px) {
  .brand__name { max-width: 120px; }
  .header-actions { gap: 0.15rem; }
  .icon-btn { width: 33px; height: 33px; }
  .lang-btn { padding-inline: 0.35rem; font-size: 0.72rem; }
  .container { padding-inline: 0.45rem; }
  .hero__stats { grid-template-columns: 1fr; }
}

/* ─────────────────────────── PWA & Tool Install UI ─────────────────────────── */
.pwa-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.pwa-modal-backdrop.is-open {
  opacity: 1; pointer-events: auto;
}
.pwa-modal {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px;
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column;
  transform: translateY(14px) scale(0.97); transition: transform 0.22s ease;
}
.pwa-modal-backdrop.is-open .pwa-modal {
  transform: translateY(0) scale(1);
}
.pwa-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-elev); z-index: 5;
}
.pwa-modal__title-box { display: flex; align-items: center; gap: 0.65rem; }
.pwa-modal__title-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.pwa-modal__head h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.pwa-modal__close {
  background: transparent; border: none; color: var(--fg-muted);
  cursor: pointer; padding: 0.45rem; border-radius: 8px;
  display: grid; place-items: center; transition: 0.15s;
}
.pwa-modal__close:hover { background: var(--bg-soft); color: var(--fg); }
.pwa-modal__body { padding: 1.3rem; display: flex; flex-direction: column; gap: 1.15rem; }

.pwa-tool-highlight {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.1rem; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 14px;
}
.pwa-tool-highlight__icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.pwa-tool-highlight__icon svg { width: 26px; height: 26px; }
.pwa-tool-highlight__info { flex: 1; min-width: 0; }
.pwa-tool-highlight__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.2rem; }
.pwa-tool-highlight__desc { font-size: 0.84rem; color: var(--fg-muted); margin: 0; line-height: 1.45; }

.pwa-features-badge-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pwa-feature-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--brand-soft); color: var(--brand);
  font-size: 0.78rem; font-weight: 700; padding: 0.25rem 0.65rem; border-radius: 999px;
}
.pwa-feature-badge svg { width: 13px; height: 13px; }

.pwa-actions-box { display: flex; flex-direction: column; gap: 0.65rem; }
.pwa-primary-install-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.8rem 1.2rem; font-size: 1rem; font-weight: 700;
  border-radius: 12px; cursor: pointer;
}
.pwa-shortcut-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.65rem 1rem; font-size: 0.88rem; font-weight: 600;
  border-radius: 12px; cursor: pointer;
}

.pwa-tabs-nav {
  display: flex; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.25rem; gap: 0.25rem;
}
.pwa-tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.5rem; background: transparent; border: none; border-radius: 9px;
  font-size: 0.82rem; font-weight: 700; color: var(--fg-muted); cursor: pointer;
  transition: all 0.15s ease;
}
.pwa-tab-btn.is-active {
  background: var(--bg-elev); color: var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.pwa-tab-pane {
  display: none; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.1rem; font-size: 0.88rem; line-height: 1.6;
}
.pwa-tab-pane.is-active { display: block; }
.pwa-steps-list {
  margin: 0; padding-inline-start: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.pwa-steps-list li b { color: var(--brand); }

.pwa-batch-filter-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
}
.pwa-tool-checklist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.45rem; max-height: 250px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 12px; padding: 0.7rem; background: var(--bg-soft);
}
.pwa-tool-check-item {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.55rem;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 9px;
  font-size: 0.82rem; cursor: pointer; user-select: none; transition: border-color 0.15s;
}
.pwa-tool-check-item:hover { border-color: var(--brand); }
.pwa-tool-check-item input[type="checkbox"] { cursor: pointer; accent-color: var(--brand); }
.pwa-tool-check-item svg { width: 16px; height: 16px; color: var(--brand); }

/* ─────────────────────────── Professional PDF Editor ─────────────────────────── */
.pdf-editor {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}
.pdf-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pdf-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pdf-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pdf-tool-btn:hover {
  background: var(--bg-soft);
  color: var(--brand);
}
.pdf-tool-btn.active {
  background: var(--brand);
  color: var(--brand-fg);
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.pdf-tool-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.pdf-tool-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 0.2rem;
  align-self: center;
}
.pdf-editor-propbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.8rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
}
.pdf-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s, border-color 0.15s;
}
.pdf-color-swatch:hover {
  transform: scale(1.15);
}
.pdf-color-swatch.active {
  border-color: var(--fg);
  transform: scale(1.15);
}
.pdf-editor-viewport {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 540px;
  max-height: 780px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1rem;
}
.pdf-editor-stage {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08);
  border-radius: 2px;
  user-select: none;
}
.pdf-editor-stage canvas.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
}
.pdf-editor-stage canvas.pdf-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.pdf-editor-stage .pdf-elements-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.pdf-annot-el {
  position: absolute;
  pointer-events: auto;
  cursor: move;
  box-sizing: border-box;
  user-select: none;
}
.pdf-annot-el.selected {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
}
.pdf-annot-el.editing-active {
  z-index: 30 !important;
}
.pdf-annot-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  pointer-events: auto;
}
.pdf-annot-handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.pdf-annot-handle.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.pdf-annot-handle.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.pdf-annot-handle.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.pdf-annot-del {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  pointer-events: auto;
  border: 2px solid #fff;
  z-index: 10;
}
.pdf-editor-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.pdf-stamp-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  transform: rotate(-6deg);
  opacity: 0.9;
  user-select: none;
}
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pdf-modal-dialog {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow: auto;
  padding: 1.4rem;
}
.pdf-sig-pad {
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: crosshair;
  width: 100%;
  height: 180px;
  touch-action: none;
  display: block;
}

/* PDF Text Editing & Detection Layer */
.pdf-editor-stage .pdf-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.pdf-editor-stage .pdf-text-layer.highlight-active {
  z-index: 25;
}
.pdf-text-item-box {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  border: 1px dashed rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.05);
  border-radius: 2px;
  transition: all 0.15s ease;
  user-select: none;
}
.pdf-text-item-box:hover {
  background: rgba(15, 118, 110, 0.22);
  border: 1.5px solid var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.35);
  z-index: 10;
}
.pdf-text-layer.highlight-active .pdf-text-item-box {
  border: 1px dashed rgba(15, 118, 110, 0.6);
  background: rgba(15, 118, 110, 0.08);
}
.pdf-text-layer.highlight-active .pdf-text-item-box::after {
  content: "✎";
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.pdf-text-layer.highlight-active .pdf-text-item-box:hover::after {
  opacity: 1;
}
.pdf-text-item-box.masked-hidden {
  display: none !important;
}
.pdf-text-item-box.matched {
  background: rgba(234, 179, 8, 0.35);
  border: 1.5px solid #ca8a04;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.4);
}
.pdf-annot-editable {
  width: 100%;
  min-height: 100%;
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border: none;
  background: #ffffff;
  color: inherit;
  font: inherit;
  resize: none;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1px 4px;
  margin: 0;
  cursor: text;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.pdf-format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pdf-format-btn:hover {
  background: var(--bg-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.pdf-format-btn.active {
  background: var(--brand);
  color: var(--brand-fg);
  border-color: var(--brand);
}
.pdf-format-btn svg {
  width: 15px;
  height: 15px;
}
.pdf-text-detect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
}
[data-theme="dark"] .pdf-text-detect-banner {
  background: #172554;
  border-color: #1e3a8a;
  color: #93c5fd;
}

/* ─────────────────────────── Professional Icon Maker ─────────────────────────── */
.icon-maker-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}
@media (max-width: 991px) {
  .icon-maker-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 2.5rem;
  }
}
.icon-preview-sticky {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 10;
}
@media (max-width: 991px) {
  .icon-preview-sticky {
    position: relative !important;
    top: auto !important;
    z-index: 10;
    width: 100%;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
  }
  .icon-preview-sticky.is-pinned {
    position: sticky !important;
    top: calc(var(--header-h, 52px) + 2px) !important;
    z-index: 45;
  }
}
.icon-preview-card {
  --stage-size-desktop: 220px;
  --stage-size-mobile: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.15rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 991px) {
  .icon-preview-card {
    padding: 0.45rem 0.65rem;
    gap: 0.35rem;
    background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }
}

.icon-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.4rem;
  gap: 0.35rem;
}
.icon-preview-header-start {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.icon-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Dynamic Size Switcher */
.icon-size-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.icon-size-btn {
  padding: 0.18rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.icon-size-btn:hover {
  color: var(--fg);
}
.icon-size-btn.active {
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Stage Body & Collapsible Container */
.icon-stage-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.45rem;
  transition: all 0.2s ease;
}
.icon-preview-card.is-collapsed .icon-stage-body {
  display: none !important;
}
.icon-stage-collapsed-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.icon-preview-card.is-collapsed .icon-stage-collapsed-bar {
  display: flex !important;
}
.icon-stage-collapsed-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.icon-stage-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.icon-stage-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  margin: 0 auto;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
  overflow: hidden;
  touch-action: none; /* Disables default scroll so touch moves icon */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}
.icon-preview-card[data-stage-size="compact"] .icon-stage-wrapper {
  width: 160px;
  height: 160px;
}
.icon-preview-card[data-stage-size="normal"] .icon-stage-wrapper {
  width: 220px;
  height: 220px;
}
.icon-preview-card[data-stage-size="large"] .icon-stage-wrapper {
  width: 280px;
  height: 280px;
}

@media (max-width: 991px) {
  .icon-stage-wrapper {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px;
    min-height: 70px;
    border-radius: 12px;
    margin: 0 auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  }
  .icon-preview-card[data-stage-size="compact"] .icon-stage-wrapper {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px;
    min-height: 50px;
    border-radius: 10px;
  }
  .icon-preview-card[data-stage-size="normal"] .icon-stage-wrapper {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px;
    min-height: 70px;
    border-radius: 12px;
  }
  .icon-preview-card[data-stage-size="large"] .icon-stage-wrapper {
    width: 95px !important;
    height: 95px !important;
    min-width: 95px;
    min-height: 95px;
    border-radius: 14px;
  }
  .icon-stage-drag-hint {
    display: none !important;
  }
  .icon-mockups-container {
    display: none !important;
  }
}
@media (max-width: 400px) {
  .icon-stage-wrapper {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px;
    min-height: 64px;
  }
  .icon-preview-card[data-stage-size="compact"] .icon-stage-wrapper {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px;
    min-height: 46px;
  }
  .icon-preview-card[data-stage-size="normal"] .icon-stage-wrapper {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px;
    min-height: 64px;
  }
  .icon-preview-card[data-stage-size="large"] .icon-stage-wrapper {
    width: 86px !important;
    height: 86px !important;
    min-width: 86px;
    min-height: 86px;
  }
}

/* Quick Tool Action Buttons */
.icon-stage-quick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  width: 100%;
}
.icon-stage-quick-actions .btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.icon-stage-quick-actions .btn svg {
  width: 14px;
  height: 14px;
}
@media (max-width: 480px) {
  .icon-stage-quick-actions {
    gap: 0.25rem;
  }
  .icon-stage-quick-actions .btn {
    padding: 0.18rem 0.4rem;
    font-size: 0.68rem;
    min-height: 26px;
  }
}

.icon-stage-wrapper.is-dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 2px var(--brand), 0 6px 18px rgba(15, 118, 110, 0.35);
  transform: scale(1.03);
}
.icon-stage-drag-hint {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.icon-stage-wrapper:hover .icon-stage-drag-hint,
.icon-stage-wrapper:active .icon-stage-drag-hint,
.icon-stage-wrapper.is-dragging .icon-stage-drag-hint {
  opacity: 0.92;
}
.icon-stage-wrapper.checker {
  background-image: linear-gradient(45deg, rgba(0,0,0,0.06) 25%, transparent 25%),
                    linear-gradient(-45deg, rgba(0,0,0,0.06) 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.06) 75%),
                    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.06) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
[data-theme="dark"] .icon-stage-wrapper.checker {
  background-image: linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
                    linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.05) 75%),
                    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.05) 75%);
  background-color: #0b1120;
}
.icon-stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.icon-mockups-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .icon-mockups-container {
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }
  .icon-mockup-phone {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .icon-mockup-avatar {
    width: 32px;
    height: 32px;
  }
  .icon-mockup-tab {
    padding: 0.2rem 0.35rem;
    font-size: 0.65rem;
  }
  .icon-mockup-item span {
    font-size: 0.67rem;
  }
}
.icon-mockup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}
.icon-mockup-item img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  max-width: 100%;
  object-fit: contain;
}
.icon-mockup-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.7rem;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.icon-mockup-tab img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.icon-mockup-phone {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.icon-mockup-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* Control Tabs Bar */
.icon-main-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 0.85rem;
}
.icon-main-tabs::-webkit-scrollbar {
  display: none;
}
.icon-main-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 38px;
  flex: 1 0 auto;
}
.icon-main-tab:hover {
  color: var(--fg);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .icon-main-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}
.icon-main-tab.active {
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
}
.icon-main-tab svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.icon-controls-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .icon-controls-card {
    padding: 1rem 0.75rem;
    gap: 1rem;
  }
}
.icon-nav-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.icon-nav-tabs::-webkit-scrollbar {
  display: none;
}
.icon-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 38px;
}
.icon-nav-tab:hover {
  background: var(--bg-soft);
  color: var(--fg);
}
.icon-nav-tab.active {
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.icon-nav-tab svg {
  width: 15px;
  height: 15px;
}
.icon-presets-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.icon-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 36px;
  flex-shrink: 0;
}
.icon-preset-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.icon-shapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 0.45rem;
}
@media (max-width: 480px) {
  .icon-shapes-grid {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 0.35rem;
  }
}
.icon-shape-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--fg);
  min-width: 40px;
  position: relative;
}
.icon-shape-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.icon-shape-btn.active {
  border-color: var(--brand);
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.28);
}
.icon-shape-btn svg {
  width: 22px;
  height: 22px;
}
.icon-gradients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.4rem;
}
.icon-grad-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, border-color 0.15s ease;
  min-height: 36px;
}
.icon-grad-swatch:hover {
  transform: scale(1.12);
  z-index: 2;
}
.icon-grad-swatch.active {
  border-color: var(--fg);
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.icon-library-search {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.icon-library-categories {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  margin-bottom: 0.6rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.icon-library-categories::-webkit-scrollbar {
  display: none;
}
.icon-cat-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  cursor: pointer;
  white-space: nowrap;
  min-height: 34px;
}
.icon-cat-pill.active {
  background: var(--brand);
  color: var(--brand-fg);
  border-color: var(--brand);
}
.icon-symbols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 0.45rem;
  max-height: 250px;
  overflow-y: auto;
  padding: 0.45rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  .icon-symbols-grid {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.35rem;
    max-height: 220px;
  }
}
.icon-symbol-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}
.icon-symbol-btn:hover {
  border-color: var(--brand);
  background: var(--bg);
  color: var(--brand);
  transform: scale(1.08);
}
.icon-symbol-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.28);
}
.icon-symbol-btn svg {
  width: 22px;
  height: 22px;
}
/* 3D Colored Symbols and Shapes */
.icon-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 0.45rem;
  max-height: 270px;
  overflow-y: auto;
  padding: 0.45rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  .icon-3d-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 0.35rem;
    max-height: 230px;
  }
}
.icon-3d-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  min-height: 46px;
}
.icon-3d-btn:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: var(--brand);
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.icon-3d-btn.active {
  border-color: var(--brand);
  background: rgba(15, 118, 110, 0.12);
  box-shadow: 0 0 0 2px var(--brand), 0 4px 12px rgba(15, 118, 110, 0.25);
  transform: scale(1.08);
}
.icon-3d-palettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.4rem;
}
.icon-3d-palette-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 36px;
}
.icon-3d-palette-btn:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.icon-3d-palette-btn.active {
  border-color: var(--brand);
  background: rgba(15, 118, 110, 0.12);
  box-shadow: 0 0 0 1.5px var(--brand);
}
.icon-3d-palette-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.icon-angle-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.icon-angle-btn {
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  min-height: 30px;
}
.icon-angle-btn:hover {
  border-color: var(--brand);
}
.icon-angle-btn.active {
  background: var(--brand);
  color: var(--brand-fg);
  border-color: var(--brand);
}
.icon-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}
@media (max-width: 480px) {
  .icon-download-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
}

/* Mobile Sticky Live Bar */
.icon-mobile-bar {
  display: none;
}
@media (max-width: 900px) {
  .icon-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.85rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: rgba(var(--bg-rgb, 255, 255, 255), 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.14);
    z-index: 85;
  }
  [data-theme="dark"] .icon-mobile-bar {
    background: rgba(15, 23, 42, 0.95);
  }
  .icon-mobile-thumb-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    text-align: right;
  }
  .icon-mobile-thumb-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    object-fit: contain;
    background: var(--bg-soft);
    border: 1.5px solid var(--line);
    transition: transform 0.15s ease;
  }
  .icon-mobile-thumb-wrap:hover .icon-mobile-thumb-img,
  .icon-mobile-thumb-wrap:active .icon-mobile-thumb-img {
    transform: scale(1.08);
  }
}

/* Mobile Live Preview Modal / Popover */
.icon-mobile-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.icon-mobile-modal.is-hidden {
  display: none !important;
}
.icon-mobile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.icon-mobile-modal-content {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  animation: iconModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@keyframes iconModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.icon-mobile-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}



.icon-section-group {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.icon-section-group.is-hidden {
  display: none !important;
}

@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; }
}
