@font-face {
  font-family: Cairo;
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/fonts/cairo-var-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-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;
}
@font-face {
  font-family: Cairo;
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/fonts/cairo-var-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;
}

:root {
  color-scheme: light;
  --ink: #161324;
  --muted: #58516e;
  --line: #e5e0f4;
  --line-strong: #cfc6ee;
  --paper: #ffffff;
  --surface: #ffffff;
  --out-bg: #f8f6ff;
  --wash: #f3effe;
  --wash-hover: #e8e1fe;
  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --blue: #2563eb;
  --emerald: #15803d;
  --emerald-bg: #dcfce7;
  --grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%);
  --grad-text: linear-gradient(90deg, #7c3aed, #a855f7, #2563eb);
  --hero-bg: linear-gradient(180deg, #ece8ff 0%, #f6f4ff 60%, #ffffff 100%);
  --header-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: #f7f5fc;
  --shadow-sm: 0 4px 14px rgba(37, 24, 88, 0.06);
  --shadow: 0 16px 42px rgba(48, 30, 120, 0.11);
  --radius: 18px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f1ff;
  --muted: #b1a9c9;
  --line: #2b2544;
  --line-strong: #43396b;
  --paper: #0e0c18;
  --surface: #171428;
  --out-bg: #120f20;
  --wash: #221d3a;
  --wash-hover: #2d264c;
  --violet: #a78bfa;
  --violet-dark: #8b5cf6;
  --blue: #60a5fa;
  --emerald: #22c55e;
  --emerald-bg: rgba(34, 197, 94, 0.16);
  --grad: linear-gradient(135deg, #7c3aed 0%, #6366f1 60%, #2563eb 100%);
  --grad-text: linear-gradient(90deg, #c084fc, #818cf8, #60a5fa);
  --hero-bg: linear-gradient(180deg, #1d1638 0%, #131024 62%, #0e0c18 100%);
  --header-bg: rgba(14, 12, 24, 0.88);
  --footer-bg: #131022;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Cairo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  font-size: 1.04rem;
  overflow-x: hidden;
}

a { color: var(--violet); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color 0.15s; }
a:hover { color: var(--blue); }
img { max-width: 100%; height: auto; }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -56px;
  background: var(--violet-dark);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  z-index: 100;
  text-decoration: none;
}
.skip:focus { top: 10px; }

.wrap { width: min(980px, calc(100% - 32px)); margin-inline: auto; }

/* ===== Sticky Header & Brand ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 66px;
  padding: 6px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.28);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-ar { font-weight: 800; font-size: 1.14rem; color: var(--ink); }
.brand-en { font-size: 0.76rem; font-weight: 700; color: var(--muted); letter-spacing: 0.01em; }
.brand-en em { font-style: normal; color: var(--violet); }

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--wash); color: var(--violet); }
.nav a.active { background: var(--wash); color: var(--violet); }

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.icon-toggle, .pwa-top-btn, .menu-btn {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.icon-toggle { min-width: 42px; padding: 6px; }
.icon-toggle:hover, .pwa-top-btn:hover, .menu-btn:hover { background: var(--wash); border-color: var(--line-strong); }
.pwa-top-btn { color: var(--violet); background: var(--wash); border-color: transparent; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
.menu-btn { display: none; }

/* ===== Hero Band (Unified Across Site) ===== */
.hero-band, .hero {
  background: var(--hero-bg);
  padding: 36px 0 26px;
}
.hero-band { text-align: center; padding: 40px 0 28px; }
.crumbs {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.hero-band .crumbs { justify-content: center; }
.crumbs a { color: var(--violet); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

h1 {
  font-size: clamp(1.85rem, 4.4vw, 3.05rem);
  font-weight: 800;
  line-height: 1.32;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub, .sub {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  max-width: 680px;
  margin: 0 0 20px;
  line-height: 1.7;
}
.hero-band .hero-sub { margin-inline: auto; }

/* ===== Flagship Bidirectional RTL Translator Card ===== */
.tool {
  text-align: initial;
  max-width: 920px;
  margin: 18px auto 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-band .tool { margin-bottom: 6px; }

.tool-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.dirs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--wash);
  padding: 4px;
  border-radius: 14px;
}
.dirs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.dirs button:hover { color: var(--ink); }
.dirs button[aria-pressed="true"] {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}

.swap-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--violet);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s, transform 0.2s, border-color 0.15s;
}
.swap-btn:hover { background: var(--wash-hover); border-color: var(--line-strong); }
.swap-btn.spinning svg { transform: rotate(180deg); transition: transform 0.28s ease; }

.panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.pane-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 228px;
  padding: 14px 18px;
}
.pane-source {
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
}
.pane-target {
  background: var(--out-bg);
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 34px;
}
.pane-label-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pane-title {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--ink);
}
.auto-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--violet);
}
.auto-pill[hidden] { display: none; }

.pane-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mini-btn {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mini-btn:hover { color: var(--violet); border-color: var(--line-strong); background: var(--wash); }

.pane-box textarea {
  width: 100%;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.14rem;
  line-height: 1.65;
  padding: 4px 0;
  min-height: 124px;
  resize: none;
}
.pane-box textarea:focus { outline: none; }
.pane-box textarea::placeholder { color: var(--muted); opacity: 0.72; font-weight: 400; font-size: 1rem; }
.pane-target textarea { font-weight: 700; }

.franco-text, textarea[dir="ltr"], .kb-out {
  direction: ltr;
  text-align: left;
  font-family: system-ui, -apple-system, "Segoe UI", Cairo, sans-serif;
}
td.franco-text {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  margin-top: 8px;
}
.count {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}
.out-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.btn-copy, .copy {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 0;
  background: var(--grad);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.24);
  transition: transform 0.12s, opacity 0.15s;
}
.btn-copy:hover, .copy:hover { opacity: 0.94; transform: translateY(-1px); }
.btn-copy { flex: 1; }

.btn-wa {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(22, 163, 74, 0.32);
  background: var(--emerald-bg);
  color: var(--emerald);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: transform 0.12s, background 0.15s;
}
.btn-wa:hover { transform: translateY(-1px); color: var(--emerald); }

.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 11px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}
.chips button {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chips button:hover { background: var(--wash-hover); border-color: var(--violet); color: var(--violet); }

/* ===== Main Content & Typography ===== */
main { padding-top: 12px; padding-bottom: 48px; }
h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  line-height: 1.4;
  margin: 1.9em 0 0.55em;
  display: flex;
  align-items: center;
  gap: 10px;
}
main > h2::before, .post > h2::before {
  content: "";
  width: 5px;
  height: 24px;
  border-radius: 4px;
  background: var(--grad);
  flex-shrink: 0;
}
h3 {
  font-size: 1.16rem;
  font-weight: 800;
  margin: 1.4em 0 0.4em;
}
main > p, main > ul, main > ol {
  max-width: 100%;
}
.post { max-width: 820px; margin-inline: auto; }
.en-note {
  direction: ltr;
  text-align: left;
  background: var(--wash);
  border-inline-start: 4px solid var(--violet);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== AI-Overview Direct Answer Callout ===== */
.ai-summary {
  background: var(--wash);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 16px 20px;
  margin: 18px 0 22px;
}
.ai-summary strong { color: var(--violet); }

/* ===== Tables & Phrase Dictionary ===== */
.dict-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 20px;
  box-shadow: var(--shadow-sm);
}
.search-box {
  position: relative;
  margin-bottom: 12px;
}
input[type="search"], input[type="text"].decor-in {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--out-bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.02rem;
  padding: 10px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="search"]:focus, input[type="text"].decor-in:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters button {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.filters button:hover { background: var(--wash); }
.filters button[aria-pressed="true"] {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
}
.hidden-row { display: none !important; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin: 14px 0 22px;
}
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: start;
  vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--out-bg); }
th {
  background: var(--wash);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--ink);
}
table.chart td:nth-child(2) {
  cursor: pointer;
  font-weight: 800;
  color: var(--violet);
  position: relative;
}
table.chart td:nth-child(2):hover {
  background: var(--wash);
}
.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.row-actions .copy {
  min-height: 38px;
  padding: 6px 13px;
  font-size: 0.86rem;
  border-radius: 10px;
}
.row-actions .wa-mini {
  min-height: 38px;
  min-width: 38px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(22, 163, 74, 0.3);
  background: var(--emerald-bg);
  color: var(--emerald);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Demo Chat Bubbles & Number Chips ===== */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
}
.demo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--out-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.demo-card:hover {
  transform: translateY(-2px);
  border-color: var(--violet);
  box-shadow: var(--shadow-sm);
}
.bubble {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}
.bubble-out {
  background: var(--grad);
  color: #fff;
  border: 0;
}
.demo-arrow {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.num-chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 800;
  color: var(--violet);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.num-chip:hover { background: var(--wash); transform: translateY(-1px); }

/* ===== Answer Hero (Phrase Subpages) ===== */
.answer-hero {
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--wash);
  padding: 24px 20px;
  margin: 14px 0 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.answer-franco {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  margin: 6px 0 14px;
  direction: ltr;
  color: var(--violet);
}
.answer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ===== On-Screen Franco Keyboard (33 Arabic Keys + Hints) ===== */
.kb-card {
  padding: 18px;
}
.kb-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.kb-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-pane label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}
.kb-in, .kb-out {
  width: 100%;
  min-height: 84px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--out-bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.18rem;
  font-weight: 700;
  padding: 12px 14px;
  resize: vertical;
}
.kb-out {
  background: var(--wash);
  border-color: var(--line-strong);
  color: var(--violet);
  word-break: break-word;
}
.keys {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0;
}
.key-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
}
.key-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 3fr 2fr 1.6fr;
  gap: 6px;
}
.key {
  min-height: 50px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 1.12rem;
  padding: 4px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  box-shadow: 0 2px 0 var(--line);
  transition: background 0.1s, transform 0.08s;
  user-select: none;
}
.key:hover { background: var(--wash); border-color: var(--violet); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key small {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--violet);
  direction: ltr;
  margin-top: 2px;
}
.key-Action { font-size: 0.92rem; background: var(--wash); }

/* ===== Stylish Franco Name Decorator (/franco-names/) ===== */
.decor-studio {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 22px;
  margin: 22px 0 28px;
  box-shadow: var(--shadow);
}
.decor-studio h2 { margin-top: 0; }
.decor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.decor-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--out-bg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.decor-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.decor-tag { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.decor-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== PWA Install Banner & Modal ===== */
.pwa-card {
  background: var(--wash);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 20px 22px;
  margin: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.pwa-card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.pwa-card p { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 60ch; }
.pwa-steps {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.93rem;
}
.pwa-steps[hidden] { display: none; }

/* ===== Section Headers, Blog Cards & Tool Pills ===== */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2.2em 0 1em;
}
.sec-head h2 { margin: 0; }
.sec-head h2::before {
  content: "";
  width: 5px;
  height: 26px;
  border-radius: 4px;
  background: var(--grad);
}
.sec-head .more { color: var(--violet); font-weight: 800; text-decoration: none; white-space: nowrap; }

.art-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.art-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.art-card:hover {
  transform: translateY(-3px);
  border-color: var(--violet);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.art-meta { display: flex; align-items: center; justify-content: space-between; }
.art-date { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.art-chip { font-size: 0.78rem; font-weight: 800; padding: 3px 11px; border-radius: 999px; }
.chip-article { background: rgba(37, 99, 235, 0.14); color: var(--blue); }
.chip-slang { background: rgba(217, 119, 6, 0.16); color: #d97706; }
.chip-guide { background: rgba(22, 163, 74, 0.15); color: var(--emerald); }
.art-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.48; }
.art-card p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.7; }

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px;
  margin: 14px 0 22px;
}
.tool-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.tool-pill:hover { border-color: var(--violet); background: var(--wash); color: var(--violet); }

.pop-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin: 18px 0;
}
.pop-details summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--violet);
}
.pop-list {
  columns: 3;
  column-gap: 24px;
  margin: 14px 0 4px;
  padding-inline-start: 20px;
}
.pop-list li { margin: 5px 0; break-inside: avoid; font-size: 0.94rem; }

/* ===== Modern Accessible FAQ Accordions ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 24px;
  max-width: 840px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s;
}
.faq-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 800;
  font-size: 1.04rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; background: var(--grad); color: #fff; }
.faq-body {
  padding: 0 18px 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.faq-body p { margin: 0; }

/* ===== Footer, Ad Slot & Toast ===== */
.ad-slot { height: 0; min-height: 0; overflow: hidden; }
.ad-slot.is-active { height: 90px; min-height: 90px; }

.site-footer {
  background: var(--footer-bg);
  color: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 42px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 28px;
}
.site-footer h2 { font-size: 1rem; font-weight: 800; margin: 0 0 12px; }
.site-footer h2::before { display: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-footer a:hover { color: var(--violet); }
.foot-brand p { color: var(--muted); margin: 12px 0 0; max-width: 320px; font-size: 0.94rem; }
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 16px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #181426;
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.94rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.post { max-width: 800px; }

/* ===== Unified Tablet & Mobile Responsive Rules ===== */
@media (max-width: 920px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; border-radius: 12px; }
  .header-row { flex-wrap: wrap; }
  .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pop-list { columns: 2; }
}

@media (max-width: 768px) {
  .hero-band, .hero { padding: 24px 0 18px; }
  .tool-controls { padding: 8px 10px; gap: 6px; flex-wrap: nowrap; }
  .dirs { flex: 1; justify-content: center; gap: 3px; padding: 3px; min-width: 0; }
  .dirs button { padding: 6px 8px; font-size: 0.8rem; flex: 1; text-align: center; white-space: nowrap; min-height: 38px; }
  .swap-label { display: none; }
  .swap-btn { padding: 6px; min-width: 40px; min-height: 40px; }

  .panes { grid-template-columns: 1fr; }
  .pane-source {
    border-inline-end: 0;
    border-bottom: 2px solid var(--line);
  }
  .pane-box { min-height: 168px; padding: 12px 14px; }
  .pane-box textarea { min-height: 92px; font-size: 1.08rem; }

  .kb-io, .decor-grid, .art-grid, .footer-grid { grid-template-columns: 1fr; }
  .pop-list { columns: 1; }
  .key { min-height: 46px; font-size: 1rem; border-radius: 9px; }
  .key small { font-size: 0.58rem; }
  .key-actions-row { grid-template-columns: repeat(3, 1fr); }
  .pwa-top-btn span { display: none; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 22px); }
  .brand-ar { font-size: 1.02rem; }
  .brand-en { font-size: 0.7rem; }
  .key-grid { gap: 4px; }
  .key { min-height: 44px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}


/* ===== v5.1: Content-V1 Style Switch (الأرقام / الحروف), Alternatives Bar, SERP CTA & Mini Name Tool ===== */
.tool-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 18px;
  background: var(--out-bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.style-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.style-label {
  color: var(--muted);
  font-weight: 700;
}
.style-pills {
  display: inline-flex;
  gap: 4px;
  background: var(--wash);
  padding: 3px;
  border-radius: 10px;
}
.style-pills button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 3px 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.style-pills button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--violet);
  box-shadow: 0 2px 6px rgba(37, 24, 88, 0.1);
}

.alts-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--wash);
  border: 1px solid var(--line-strong);
  font-size: 0.86rem;
}
.alts-bar[hidden] { display: none; }
.alts-title {
  font-weight: 800;
  color: var(--violet);
}
.alt-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
}
.alt-tok {
  font-size: 0.78rem;
  color: var(--muted);
  direction: ltr;
  padding-inline-end: 4px;
}
.alt-opt {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 2px 9px;
  cursor: pointer;
}
.alt-opt.is-picked {
  background: var(--grad);
  color: #fff;
}

.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--wash);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.try-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--wash);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 14px 0 22px;
}
.try-cta-bar p {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}
.try-cta-btn {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.24);
  white-space: nowrap;
}
.try-cta-btn:hover { opacity: 0.94; color: #fff !important; }

.name-mini-tool {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 18px 20px;
  margin: 14px auto 24px;
  box-shadow: var(--shadow);
  text-align: initial;
}
.name-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 10px 0 12px;
}
.name-mini-out {
  min-height: 50px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--wash);
  color: var(--violet);
  font-size: 1.24rem;
  font-weight: 800;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  direction: ltr;
  text-align: left;
}
@media (max-width: 768px) {
  .tool-subbar { padding: 8px 12px; }
  .name-mini-grid { grid-template-columns: 1fr; }
}
