/* Shared styles for every page. Linked from _includes/base.liquid with a content
   hash in the URL, so browsers keep it cached until it changes. */

/* Fonts are served from this site (Inter and Cairo, SIL Open Font License).
   Each file is a variable font covering weights 400 to 700; unicode-range lets
   the browser fetch only the scripts a page uses. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/cairo-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/cairo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── Variables ─────────────────────────────────── */
:root {
  --blue: #2563eb; --blue-d: #1d4ed8; --blue-s: #dbeafe; --blue-ss: #eff6ff;
  --amber: #d97706; --amber-s: #fef3c7;
  --violet: #7c3aed; --violet-s: #ede9fe;
  --emerald: #059669; --emerald-s: #d1fae5;
  --red: #dc2626; --red-s: #fee2e2;
  --rose: #be185d; --rose-d: #9d174d; --rose-s: #fce7f3;

  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  /* Text: slate dark grays (blue-tinted) that pair with the brand blue */
  --text: #334155;
  --text-mid: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --header-h: 64px;
  --max-w: 1180px;
  --r: 10px; --r-lg: 14px;
  --sh-sm: 0 1px 2px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.07);
  --sh: 0 2px 4px rgba(0,0,0,.05),0 4px 8px rgba(0,0,0,.05);
  --sh-lg: 0 8px 24px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.04);
  --t: .18s ease;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.65;
  min-height: 100vh; display: flex; flex-direction: column;
}
[lang="ar"] body, [lang="ar"] * {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Header ────────────────────────────────────── */
/* Frosted sticky bar; category links carry their category colour (--nc). */
.site-header {
  height: var(--header-h); position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.8); transition: box-shadow var(--t), background var(--t);
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, #1e3a8a, var(--blue) 30%, #60a5fa 55%, #94a3b8 80%, #cbd5e1);
}
.site-header.scrolled { background: rgba(255,255,255,.92); box-shadow: 0 6px 24px -12px rgba(15,23,42,.18); }
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 3px 1.25rem 0;
  height: 100%; display: flex; align-items: center; gap: 1.25rem;
}
.logo {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 1.12rem; font-weight: 800; color: var(--text);
  text-decoration: none; flex-shrink: 0; letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
/* Logo mark: _includes/logo-mark.liquid (same drawing as /favicon.svg) */
.logo-mark { width: 32px; height: 32px; display: block; flex-shrink: 0; transition: transform .25s ease; }
.logo em { color: var(--blue); font-style: normal; }

.main-nav { display: flex; align-items: center; gap: .1rem; flex: 1; }
.main-nav a, .mobile-nav a { --nc: var(--blue); }
.main-nav a.nc-math, .mobile-nav a.nc-math { --nc: var(--amber); }
.main-nav a.nc-dev, .mobile-nav a.nc-dev { --nc: var(--violet); }
.main-nav a.nc-date, .mobile-nav a.nc-date { --nc: var(--emerald); }
.main-nav a.nc-image, .mobile-nav a.nc-image { --nc: var(--rose); }
.main-nav a.nc-blog, .mobile-nav a.nc-blog { --nc: var(--text); }
.main-nav a {
  position: relative; display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .62rem; border-radius: 999px; font-size: .85rem; white-space: nowrap;
  font-weight: 600; color: var(--text-mid); text-decoration: none;
  transition: background var(--t), color var(--t);
}
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nc); opacity: .55; transition: opacity var(--t), box-shadow var(--t); flex: none; }
.main-nav a:hover { background: color-mix(in srgb, var(--nc) 8%, transparent); color: var(--text); text-decoration: none; }
.main-nav a:hover .nav-dot { opacity: 1; }
.main-nav a.active { color: var(--nc); background: color-mix(in srgb, var(--nc) 11%, #fff); }
.main-nav a.active .nav-dot { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc) 22%, transparent); }

.header-right { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.search-btn, .lang-btn, .menu-btn {
  height: 2.35rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--border); background: #fff; border-radius: 999px; color: var(--text-mid);
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; line-height: 1;
  transition: border-color var(--t), color var(--t), box-shadow var(--t), background var(--t);
}
.search-btn:hover, .lang-btn:hover, .menu-btn:hover, .lang-btn[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ss); }
.search-btn { padding: 0 .45rem 0 .7rem; min-width: 2.35rem; }
.search-btn .sb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-btn kbd { font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .2rem .4rem; background: var(--bg); }
.lang-btn { padding: 0 .8rem 0 .65rem; }
.lang-btn .chev { transition: transform var(--t); }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-short { display: none; }
@media (max-width: 1100px) { .search-btn kbd { display: none; } .search-btn { padding: 0; width: 2.35rem; } }
@media (max-width: 560px) { .lang-full { display: none; } .lang-short { display: inline; } .lang-btn .globe { display: none; } }
.search-dialog {
  width: min(640px, calc(100vw - 2rem)); max-width: none; margin: 12vh auto 0; padding: 0;
  border: 0; background: transparent; overflow: visible;
}
.search-dialog::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
.search-dialog .qs { margin: 0; }
.lang-dropdown { position: relative; display: inline-block; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .35rem;
  box-shadow: 0 18px 40px -16px rgba(15,23,42,.35); z-index: 200; min-width: 170px;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.lang-menu.open { opacity: 1; visibility: visible; transform: none; }
.lang-menu a {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 9px;
  font-size: .86rem; font-weight: 500; color: var(--text-mid); text-decoration: none;
}
.lang-menu a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.lang-menu a.active { color: var(--blue); background: var(--blue-ss); font-weight: 600; }
.lang-menu a.active::after { content: "✓"; margin-inline-start: auto; font-size: .8rem; }
.menu-btn { display: none; width: 2.35rem; padding: 0; }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded="true"] .bars { display: none; }
.menu-btn[aria-expanded="true"] .x { display: block; }

/* ── Mobile nav ────────────────────────────────── */
.mobile-nav {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
  background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); box-shadow: 0 24px 40px -20px rgba(15,23,42,.3);
  padding: .9rem 1rem 1.1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.mobile-nav.open { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 1241px) { .mobile-nav { display: none; } }
.mobile-nav a {
  display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  font-weight: 600; color: var(--text-mid); font-size: .9rem; text-decoration: none;
}
.mobile-nav a .nav-dot { opacity: 1; width: 9px; height: 9px; }
.mobile-nav a:hover { border-color: var(--nc); color: var(--text); text-decoration: none; }
.mobile-nav a.active { border-color: var(--nc); color: var(--nc); background: color-mix(in srgb, var(--nc) 8%, #fff); }

/* ── Layout helpers ────────────────────────────── */
main { flex: 1; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.page-pad { padding-top: 2rem; padding-bottom: 3.5rem; }

/* ── Breadcrumb ────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  font-size: .78rem; color: var(--text-muted); padding: 1rem 0 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .sep { opacity: .45; font-size: .7rem; }
[dir="rtl"] .breadcrumb .sep { display: inline-block; transform: scaleX(-1); }

/* ── Category badge ────────────────────────────── */
.cat-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .6rem; border-radius: 20px; font-size: .72rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.cat-badge.text  { background: var(--blue-s); color: var(--blue); }
.cat-badge.math  { background: var(--amber-s); color: var(--amber); }
.cat-badge.dev   { background: var(--violet-s); color: var(--violet); }
.cat-badge.date  { background: var(--emerald-s); color: var(--emerald); }
.cat-badge.image { background: var(--rose-s); color: var(--rose); }

/* ── Tool page header ──────────────────────────── */
/* Tool page privacy badge (see the sec_badge block in the body). */
.sec-badge { position: relative; display: inline-flex; align-items: center; gap: .3rem; margin-inline-start: .35rem; padding: .18rem .6rem; border-radius: 20px; font-size: .72rem; font-weight: 700; cursor: help; vertical-align: middle; outline: none; }
.sec-badge.on { background: #dcfce7; color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.sec-badge.off { background: #f1f5f9; color: #64748b; box-shadow: inset 0 0 0 1px #e2e8f0; }
.sec-badge:focus-visible { box-shadow: 0 0 0 3px var(--blue-s); }
.tool-header .sec-badge, .tool-header.has-art > .sec-badge.sec-badge { z-index: 20; } /* header children sit at z-index 1; keep the tooltip above the description and card */
.sec-tip { position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline-start: 0; width: max-content; max-width: min(300px, 80vw); padding: .6rem .75rem; border-radius: 10px;
  background: #0f172a; color: #e2e8f0; font-size: .78rem; font-weight: 500; line-height: 1.5; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 12px 28px -12px rgba(15,23,42,.5); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.sec-badge:hover .sec-tip, .sec-badge:focus .sec-tip { opacity: 1; visibility: visible; transform: none; }
.tool-header { margin: 1.1rem 0 1.75rem; }
.tool-header h1 {
  font-size: 1.7rem; font-weight: 700;
  letter-spacing: -.025em; margin: .5rem 0 .4rem; line-height: 1.2;
}
.tool-header p { color: var(--text-muted); font-size: .93rem; max-width: 560px; }

/* Blueprint art: the tool's icon on a fine grid with guide lines, at the
   end side of the header (left in Arabic). Colors come from .ic-{category}. */
.tool-header.has-art { position: relative; --art-w: min(44%, 360px); --ring: 116px; --glyph: 60px; --cx: 96px; }
.tool-header.has-art > :not(.th-art) { position: relative; z-index: 1; }
.tool-header.has-art h1 { max-width: calc(100% - var(--cx) * 2 - 1rem); }
.th-art {
  position: absolute; z-index: 0; pointer-events: none;
  top: -2.75rem; bottom: -1rem; inset-inline-end: 0; width: var(--art-w);
}
.th-art::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, currentColor 11%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, currentColor 11%, transparent) 1px, transparent 1px);
  background-size: 16px 16px; background-position: center;
  -webkit-mask-image: linear-gradient(to left, #000 45%, transparent);
          mask-image: linear-gradient(to left, #000 45%, transparent);
}
[dir="rtl"] .th-art::before {
  -webkit-mask-image: linear-gradient(to right, #000 45%, transparent);
          mask-image: linear-gradient(to right, #000 45%, transparent);
}
.th-guides::before, .th-guides::after {
  content: ""; position: absolute; border: 0 dashed color-mix(in srgb, currentColor 30%, transparent);
}
.th-guides::before { top: 50%; inset-inline: 0; border-top-width: 1px; }
.th-guides::after { top: 0; bottom: 0; inset-inline-end: var(--cx); border-inline-end-width: 1px; }
.th-ring {
  position: absolute; top: 50%; inset-inline-end: calc(var(--cx) - var(--ring) / 2);
  width: var(--ring); height: var(--ring); margin-top: calc(var(--ring) / -2);
  border: 1px dashed color-mix(in srgb, currentColor 45%, transparent); border-radius: 50%;
  background: var(--bg);
}
.th-art .ico {
  position: absolute; top: 50%; inset-inline-end: calc(var(--cx) - var(--glyph) / 2);
  width: var(--glyph); height: var(--glyph); margin-top: calc(var(--glyph) / -2);
  stroke-width: 1.1;
}

/* ── Card ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.card-head {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-body { padding: 1.5rem; }
.card-foot {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; gap: .6rem; flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .48rem 1rem; border-radius: 7px; font-size: .875rem;
  font-weight: 500; border: none; transition: all var(--t);
  line-height: 1.4; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--text-mid); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: .32rem .75rem; font-size: .8rem; }
.btn-success { background: var(--emerald); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-text-cat { background: var(--blue-s); color: var(--blue); }
.btn-math-cat { background: var(--amber-s); color: var(--amber); }
.btn-dev-cat  { background: var(--violet-s); color: var(--violet); }
.btn-date-cat { background: var(--emerald-s); color: var(--emerald); }
.btn-group { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Inputs ────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%; padding: .55rem .85rem;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: .9rem; font-family: inherit; background: #fff;
  color: var(--text); transition: border-color var(--t); outline: none;
  line-height: 1.5;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); }
.textarea { resize: vertical; min-height: 160px; }
.input-group { display: flex; gap: .5rem; align-items: flex-start; }
.input-group .input { flex: 1; }
label { font-size: .85rem; font-weight: 500; color: var(--text-mid); display: block; margin-bottom: .35rem; }
.form-row { margin-bottom: 1.1rem; }
.form-grid { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ── Range ─────────────────────────────────────── */
input[type="range"] { width: 100%; height: 4px; accent-color: var(--blue); cursor: pointer; }

/* ── Stats grid ────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .85rem 1rem; text-align: center; }
.stat-val { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-lbl { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; font-weight: 500; }

/* ── Result box ────────────────────────────────── */
.result-box {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 7px;
  padding: 1rem 1.1rem; font-family: 'Menlo','Monaco','Courier New',monospace;
  font-size: .875rem; white-space: pre-wrap; word-break: break-all;
  min-height: 80px; color: var(--text); line-height: 1.6;
}
.result-box.mono-lg { font-size: 1rem; }

/* ── Tabs ──────────────────────────────────────── */
.tabs { display: flex; gap: .2rem; border-bottom: 1.5px solid var(--border); margin-bottom: 1.25rem; }
.tab {
  padding: .45rem .9rem; font-size: .86rem; font-weight: 500;
  color: var(--text-muted); border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  transition: all var(--t);
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab:hover:not(.active) { color: var(--text); }

/* ── Alert ─────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--r); font-size: .875rem; }
.alert-info  { background: var(--blue-ss); color: var(--blue-d); border: 1px solid var(--blue-s); }
.alert-error { background: var(--red-s); color: var(--red); border: 1px solid #fca5a5; }
.alert-ok    { background: var(--emerald-s); color: var(--emerald); border: 1px solid #6ee7b7; }

/* ── Toast ─────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2937; color: #fff; padding: .65rem 1.2rem;
  border-radius: 8px; font-size: .875rem; font-weight: 500;
  z-index: 9999; transition: transform .28s ease; pointer-events: none;
  white-space: nowrap; box-shadow: var(--sh-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Footer ────────────────────────────────────── */
.site-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 2.5rem 0 0; margin-top: 4rem;
}
.footer-grid {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  gap: 2rem;
}
.footer-brand p { font-size: .84rem; color: var(--text-muted); margin-top: .65rem; max-width: 220px; line-height: 1.5; }
.footer-col h4 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint); margin-bottom: .75rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.footer-col a { font-size: .84rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-col h4 a { font-size: inherit; color: inherit; }
.footer-col h4 a:hover { color: var(--blue); }
.footer-col a.footer-more { color: var(--blue); font-weight: 600; }
.footer-about { font-weight: 600; color: var(--text-mid); }
.footer-bottom {
  max-width: var(--max-w); margin: 2rem auto 0; padding: 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .78rem; color: var(--text-faint);
}

/* ── Related tools ─────────────────────────────── */
.related-tools { margin-top: 3rem; }
.related-tools h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.tool-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tool-mini-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem 1.1rem;
  transition: box-shadow var(--t), border-color var(--t);
  display: flex; align-items: flex-start; gap: .75rem;
}
.tool-mini-card:hover { box-shadow: var(--sh); border-color: #d1d5db; text-decoration: none; }
.tool-mini-card .tm-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: .05rem; }

/* Tool icons: thin outline SVGs in the category color (see .eleventy.js "icon" filter) */
.ico { display: block; width: 1em; height: 1em; flex: none; overflow: visible; }
.ic-text  { color: var(--blue); }
.ic-math  { color: var(--amber); }
.ic-dev   { color: var(--violet); }
.ic-date  { color: var(--emerald); }
.ic-image { color: var(--rose); }
.tool-mini-card .tm-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.tool-mini-card .tm-desc { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; line-height: 1.4; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
/* The full nav needs about 1220px (French is longest); below that the menu button takes over. */
@media (max-width: 1240px) {
  .main-nav { display: none; }
  .header-right { margin-inline-start: auto; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 700px) {
  .tool-header h1 { font-size: 1.4rem; }
  .tool-header.has-art { --art-w: 46%; --ring: 64px; --glyph: 32px; --cx: 46px; }
  /* Keep the art beside the badge and title, clear of the breadcrumb and description */
  .tool-header.has-art .th-art { top: -.25rem; bottom: auto; height: calc(var(--ring) + 1rem); }
  .tool-header.has-art h1 { min-height: calc(var(--ring) - 1.5rem); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-body { padding: 1.1rem; }
  .card-foot { padding: .85rem 1.1rem; }
}

/* ── RTL overrides ─────────────────────────────── */
[dir="rtl"] .input-group { flex-direction: row-reverse; }
[dir="rtl"] .btn-group { flex-direction: row-reverse; }

/* ── Quick tool search (_includes/quick-search.liquid) ── */
.qs {
  --qs-accent: var(--blue); --qs-ring: rgba(37,99,235,.18);
  position: relative; z-index: 20; width: 100%; max-width: 640px; text-align: start;
}
.qs--math { --qs-accent: var(--amber); --qs-ring: rgba(217,119,6,.2); }
.qs--dev  { --qs-accent: var(--violet); --qs-ring: rgba(124,58,237,.18); }
.qs--date { --qs-accent: var(--emerald); --qs-ring: rgba(5,150,105,.2); }
.qs--image { --qs-accent: var(--rose); --qs-ring: rgba(190,24,93,.18); }
.qs--home { --qs-ring: rgba(255,255,255,.4); margin: 0 auto 1.6rem; }
.qs:not(.qs--home) { margin-top: 1.4rem; }

.qs-box { position: relative; display: flex; align-items: center; }
.qs-icon {
  position: absolute; inset-inline-start: 1.15rem; color: var(--text-faint);
  pointer-events: none; transition: color var(--t);
}
.qs-box:focus-within .qs-icon { color: var(--qs-accent); }
.qs-input {
  width: 100%; height: 3.75rem; padding: 0 3.4rem;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r-lg);
  font: inherit; font-size: 1.0625rem; line-height: 1.4;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 20px -10px rgba(16,24,40,.18);
  outline: none; -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
  transition: border-color var(--t), box-shadow var(--t);
}
.qs-input::placeholder { color: var(--text-muted); opacity: 1; }
.qs-input::-webkit-search-cancel-button,
.qs-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.qs-input:focus {
  border-color: var(--qs-accent);
  box-shadow: 0 0 0 4px var(--qs-ring), 0 8px 20px -10px rgba(16,24,40,.18);
}
.qs--home .qs-input { border-color: transparent; box-shadow: 0 14px 34px -10px rgba(15,23,42,.5); }
.qs--home .qs-input:focus { border-color: #fff; box-shadow: 0 0 0 4px var(--qs-ring), 0 14px 34px -10px rgba(15,23,42,.5); }

.qs-kbd {
  position: absolute; inset-inline-end: 1.1rem; pointer-events: none;
  min-width: 1.65rem; height: 1.65rem; padding: 0 .45rem;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-muted); background: var(--bg);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
}
.qs-input:focus ~ .qs-kbd,
.qs-input:not(:placeholder-shown) ~ .qs-kbd { display: none; }
.qs-clear {
  position: absolute; inset-inline-end: .65rem;
  width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted); transition: background var(--t), color var(--t);
}
.qs-clear:hover { background: var(--bg); color: var(--text); }
.qs-input:placeholder-shown ~ .qs-clear { display: none; }

.qs-panel {
  position: absolute; top: calc(100% + .5rem); left: 0; right: 0;
  display: flex; flex-direction: column; max-height: 27rem; overflow: hidden;
  background: #fff; color: var(--text); text-align: start;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 18px 44px -14px rgba(15,23,42,.32), 0 4px 10px -4px rgba(15,23,42,.08);
}
.qs-panel[hidden] { display: none; }
.qs-list {
  position: relative; list-style: none; padding: .4rem;
  overflow-y: auto; overscroll-behavior: contain;
}
.qs-opt {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem .7rem; border-radius: 10px; color: inherit; text-decoration: none;
}
.qs-opt:hover { text-decoration: none; }
.qs-opt.is-active { background: #f3f4f6; }
.qs-ico {
  flex: none; width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1;
}
.qs-ico--text  { color: var(--blue); }
.qs-ico--math  { color: var(--amber); }
.qs-ico--dev   { color: var(--violet); }
.qs-ico--date  { color: var(--emerald); }
.qs-ico--image { color: var(--rose); }
.qs-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qs-name { font-size: .92rem; font-weight: 600; line-height: 1.35; }
.qs-name mark { background: #fde68a; color: inherit; border-radius: 2px; }
.qs-desc {
  font-size: .78rem; color: var(--text-muted); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qs-cat {
  flex: none; padding: .18rem .55rem; border-radius: 20px;
  font-size: .68rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
}
[lang="ar"] .qs-cat { letter-spacing: 0; }
.qs-cat--text { background: var(--blue-s); color: var(--blue); }
.qs-cat--math { background: var(--amber-s); color: var(--amber); }
.qs-cat--dev  { background: var(--violet-s); color: var(--violet); }
.qs-cat--date { background: var(--emerald-s); color: var(--emerald); }
.qs-cat--image { background: var(--rose-s); color: var(--rose); }

.qs-empty { padding: 1.1rem 1.15rem 1.2rem; }
.qs-empty-title { font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.qs-empty-hint { margin-top: .2rem; font-size: .84rem; color: var(--text-muted); }
.qs-keys {
  flex: none; padding: .55rem .95rem; border-top: 1px solid var(--border);
  background: #fcfcfd; font-size: .72rem; color: var(--text-faint);
}
.qs-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (hover: none) {
  .qs-kbd, .qs-keys { display: none; }
}
@media (max-width: 700px) {
  /* 16px keeps iOS Safari from zooming in when the field gets focus. */
  .qs-input { height: 3.4rem; padding: 0 2.95rem; font-size: 1rem; }
  .qs-icon { inset-inline-start: .95rem; }
  .qs-kbd { display: none; }
  .qs:not(.qs--home) { margin-top: 1.2rem; }
}
@media (max-width: 480px) {
  .qs-cat { display: none; }
}
