@font-face {
  font-family: 'Qahwa';
  src: url('./fonts/Qahwa Arabic.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Qahwa';
  src: url('./fonts/Qahwa Arabic Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Qahwa';
  src: url('./fonts/QahwaArabicBlack.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Qahwa';
  src: url('./fonts/QahwaArabicMedium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Qahwa Salt';
  src: url('./fonts/Qahwa Arabic Salt.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geeza Web';
  src: url('./fonts/Geeza-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #000;
  --bg2:     #0a0a0a;
  --bg3:     #111;
  --bg4:     #1a1a1a;
  --text:    #fff;
  --muted:   #444;
  --muted2:  #777;
  --border:  #1a1a1a;
  --border2: #272727;
  --topbar:  56px;
  --font-black: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
  --font-med:   'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font-med); font-weight: 400;
  background: var(--bg); color: var(--text); direction: rtl;
}
.hidden { display: none !important; }

/* ══════════════════════════ SPLASH ══════════════════════════ */
#splash {
  position: fixed; inset: 0; background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; z-index: 9999;
  transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
#splash.slide-up { transform: translateY(-100%); }

#splash-logo {
  width: 110px; height: 110px;
  border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.3);
  filter: grayscale(100%);
  animation: pulsebw 2s ease-in-out infinite;
}
@keyframes pulsebw {
  0%,100% { box-shadow: 0 0 20px 4px rgba(255,255,255,0.07); }
  50%      { box-shadow: 0 0 50px 14px rgba(255,255,255,0.16); }
}
.splash-name {
  font-family: var(--font-black); font-weight: 900;
  font-size: 2.6rem; color: #fff;
  animation: fadeIn 0.7s ease 0.5s both;
}
.splash-sub {
  font-family: var(--font-med); font-weight: 500;
  font-size: 0.88rem; color: rgba(255,255,255,0.4);
  direction: ltr;
  animation: fadeIn 0.7s ease 0.9s both;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ══════════════════════════ TOPBAR ══════════════════════════ */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar);
  background: rgba(0,0,0,0.93); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100; direction: ltr;
}
#topbar-logo {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.2); cursor: pointer; filter: grayscale(100%);
  transition: border-color 0.2s, transform 0.2s;
}
#topbar-logo:hover { border-color: rgba(255,255,255,0.55); transform: scale(1.05); }
#menu-toggle {
  background: none; border: none; color: var(--text);
  font-size: 1.2rem; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; transition: background 0.2s;
}
#menu-toggle:hover { background: var(--bg3); }

/* ══════════════════════════ OVERLAY ══════════════════════════ */
#drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#drawer-overlay.open { opacity:1; pointer-events:all; }

/* ══════════════════════════ DRAWER ══════════════════════════ */
#drawer {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; max-width: 100vw;
  background: var(--bg2);
  border-left: none;
  border-radius: 0;
  z-index: 200; transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: -12px 0 48px rgba(0,0,0,0.8);
}
#drawer.open { transform: translateX(0); }
.drawer-handle-bar { display: none; }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-title { font-family: var(--font-black); font-weight: 900; font-size: 1.05rem; color: #fff; }
#drawer-close {
  background: none; border: none; color: var(--muted2);
  font-size: 1rem; cursor: pointer; padding: 6px 9px;
  border-radius: 7px; transition: all 0.2s;
}
#drawer-close:hover { background: var(--bg4); color: #fff; }
.drawer-nav { display: flex; flex-direction: column; padding: 12px 16px 28px; gap: 2px; }
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 10px;
  text-decoration: none; color: var(--muted2);
  font-family: var(--font-med); font-weight: 500; font-size: 0.97rem;
  transition: all 0.2s; cursor: pointer; border: none; background: none;
  width: 100%; text-align: right; direction: rtl;
}
.drawer-item:hover { background: var(--bg4); color: #fff; }
.drawer-item.active { background: rgba(255,255,255,0.05); color: #fff; border-right: 2px solid #fff; }
.drawer-item i { font-size: 0.88rem; width: 18px; text-align: center; flex-shrink: 0; }
.drawer-divider { height: 1px; background: var(--border); margin: 8px 8px; }

/* ══════════════════════════ LAYOUT ══════════════════════════ */
#app { padding-top: var(--topbar); min-height: 100vh; }
main#content { min-height: calc(100vh - var(--topbar)); }
.section { display: none; min-height: calc(100vh - var(--topbar)); }
.section.active { display: flex; flex-direction: column; }

/* ══════════════════════════ HOME ══════════════════════════ */
#sec-home { align-items: stretch; justify-content: flex-start; background: #000; }
.home-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center; padding: 50px 24px 40px;
}
.home-logo-wrap { position: relative; width: 160px; height: 160px; }
.home-logo {
  width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.25);
  position: relative; z-index: 1; filter: grayscale(100%);
}
.home-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  animation: spin 16s linear infinite;
}
.home-ring::after {
  content: ''; position: absolute; top: -4px; left: 50%;
  transform: translateX(-50%); width: 7px; height: 7px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 10px 4px rgba(255,255,255,0.35);
}
@keyframes spin { to { transform: rotate(360deg); } }
.home-title { font-family: var(--font-black); font-weight: 900; font-size: 3.5rem; color: #fff; line-height: 1.1; }
.home-sub { color: rgba(255,255,255,0.38); font-family: var(--font-med); font-weight: 500; font-size: 0.92rem; direction: ltr; }

/* ── HOME SLIDER ── */
.home-slider-wrap {
  width: 100%; position: relative; overflow: hidden;
  border-top: 1px solid var(--border2); border-bottom: 1px solid var(--border2);
  background: #000;
}
.home-slider-track { width: 100%; position: relative; }
.home-slider {
  position: relative; width: 100%;
  display: flex;
  align-items: flex-start;
}
.home-slide {
  position: absolute; top: 0; left: 0; right: 0;
  cursor: pointer; overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.4,0,0.2,1);
  transform: translateX(60px);
  z-index: 1;
}
.home-slide.active { position: relative; opacity: 1; pointer-events: auto; transform: translateX(0); z-index: 2; }
.home-slide.prev   { opacity: 0; transform: translateX(-60px); z-index: 1; }
.home-slide img {
  width: 100%; height: auto; object-fit: cover; display: block;
  transition: transform 0.6s ease, filter 0.4s;
  filter: brightness(0.82);
}
.home-slide:hover img { transform: scale(1.02); filter: brightness(1); }
.home-slide-label {
  position: absolute; bottom: 0; right: 0; left: 0;
  padding: 60px 32px 28px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  direction: rtl;
}
.home-slide-title {
  display: block; font-family: var(--font-black); font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 2.6rem); color: #fff; line-height: 1.1;
}
.home-slide-en {
  display: block; font-size: 0.82rem; color: rgba(255,255,255,0.45);
  font-family: var(--font-med); font-weight: 500; margin-top: 5px; direction: ltr;
}
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 20; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85); width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.slider-arrow:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.5); }
.slider-arrow-prev { right: 20px; }
.slider-arrow-next { left: 20px; }
.slider-bottom-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.home-slider-dots { display: flex; gap: 5px; }
.slider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.2); cursor: pointer;
  transition: background 0.3s, width 0.3s; border: none; padding: 0;
}
.slider-dot.active { background: #fff; width: 18px; border-radius: 3px; }
.slider-counter {
  font-family: var(--font-med); font-weight: 500;
  font-size: 0.75rem; color: rgba(255,255,255,0.3);
  direction: ltr; min-width: 40px; text-align: center;
}

/* ── HOME FONTS SECTION ── */
.home-fonts-section {
  width: 100%;
  border-top: 1px solid var(--border2);
}

/* ── PRICE BADGES ── */
.badge-free {
  font-size: 0.72rem; font-family: var(--font-med); font-weight: 500;
  color: #4ade80; border: 1px solid rgba(74,222,128,0.3);
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.02em;
}
.badge-paid {
  font-size: 0.72rem; font-family: var(--font-med); font-weight: 500;
  color: #facc15; border: 1px solid rgba(250,204,21,0.3);
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.02em;
}

/* ── ADMIN PRICE TOGGLE ── */
.price-toggle-wrap {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.pt-btn {
  background: var(--bg4); border: 1px solid var(--border2);
  color: var(--muted2); padding: 8px 20px; border-radius: 8px;
  font-family: var(--font-med); font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
}
.pt-btn.active { background: #fff; color: #000; border-color: #fff; }

/* ══════════════════════════ INNER ══════════════════════════ */
.sec-inner { width: 100%; max-width: 1100px; margin: 0 auto; padding: 50px 32px 60px; }
.sec-title {
  font-family: var(--font-black); font-weight: 900;
  font-size: 2rem; color: #fff;
  margin-bottom: 36px; position: relative; padding-bottom: 14px;
}
.sec-title::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 36px; height: 1.5px;
  background: rgba(255,255,255,0.3); border-radius: 2px;
}

/* ══════════════════════════ SEARCH BAR ══════════════════════════ */
.home-search-wrap {
  width: 100%; padding: 24px 12px 0; position: relative;
}
.home-search-box {
  position: relative; display: flex; align-items: center;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 18px; overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.home-search-box:focus-within {
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 4px 24px rgba(0,0,0,0.5);
}
.search-icon {
  padding: 0 16px; color: var(--muted2); font-size: 0.9rem; flex-shrink: 0; pointer-events: none;
}
#font-search {
  flex: 1; background: transparent; border: none; padding: 14px 0;
  color: var(--text); font-family: var(--font-med); font-size: 0.97rem;
  outline: none; direction: rtl;
}
#font-search::placeholder { color: var(--muted); }
.search-clear {
  background: none; border: none; color: var(--muted2); cursor: pointer;
  padding: 0 16px; font-size: 0.85rem; transition: color 0.2s;
}
.search-clear:hover { color: #fff; }
.search-suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; overflow: hidden; z-index: 50;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}
.suggestion-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; cursor: pointer; direction: rtl;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg4); }
.sug-ar { font-family: var(--font-black); font-weight: 900; font-size: 0.95rem; color: #fff; }
.sug-en { font-family: var(--font-med); font-size: 0.78rem; color: var(--muted2); direction: ltr; }

/* ══════════════════════════ ACCOUNTS LIST ══════════════════════════ */
.accounts-list {
  width: 100%;
  display: flex; flex-direction: column;
}
.accounts-group {
  width: 100%;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border2);
}
.accounts-group:last-child { border-bottom: none; }
.accounts-group-title {
  font-family: var(--font-black); font-weight: 900;
  font-size: 1rem; color: rgba(255,255,255,0.35);
  padding: 0 20px 18px; letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ══════════════════════════ SOCIAL ══════════════════════════ */
.social-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 0 12px; }
.links-empty { color: var(--muted2); text-align: center; width: 100%; padding: 40px 0; font-size: 0.95rem; }

.social-row-card {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 72px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 18px; text-decoration: none; color: var(--text);
  transition: border-color 0.22s, background 0.22s, transform 0.15s, box-shadow 0.22s;
}
.social-row-card:hover {
  border-color: rgba(255,255,255,0.28);
  background: var(--bg3);
  transform: scale(1.012);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.social-row-card:active { transform: scale(0.98); }
.src-icon {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: rgba(255,255,255,0.85); flex-shrink: 0;
  transition: color 0.2s;
}
.social-row-card:hover .src-icon { color: #fff; }
.src-icon svg { width: 28px; height: 28px; fill: currentColor; }

/* ══════════════════════════ FONT CARDS ══════════════════════════ */
.fonts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--border2);
}
@media (max-width: 600px) { .fonts-grid { grid-template-columns: 1fr; } }

.font-card {
  background: #000; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: background 0.25s; position: relative;
}
.font-card:hover { background: #0a0a0a; }
.font-card:hover .font-card-arrow { opacity: 1; transform: translateX(0); }

.font-card-body {
  padding: 22px 20px 14px;
  flex: 1;
}
.font-card-preview {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.15;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; direction: rtl;
}
.font-card-ar {
  color: #fff; flex-shrink: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.font-card-en {
  color: rgba(255,255,255,0.65); direction: ltr;
  flex-shrink: 1; min-width: 0; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.font-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  gap: 10px;
}
.font-card-footer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.font-card-arrow {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  opacity: 0; transform: translateX(4px);
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.font-card-weights {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.weight-tag {
  font-size: 0.72rem; color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 3px 9px;
  font-family: var(--font-med); font-weight: 500;
  letter-spacing: 0.01em;
}

.empty-msg { color: var(--muted2); text-align: center; padding: 60px 20px; font-size: 1rem; font-family: var(--font-med); }

/* ══════════════════════════ FONT DETAIL PAGE ══════════════════════════ */
#sec-font-detail { background: #000; }
.font-detail-page { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 0 100px; }
.font-detail-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--muted2);
  font-family: var(--font-med); font-weight: 500; font-size: 0.9rem;
  cursor: pointer; padding: 22px 24px; transition: color 0.2s; direction: rtl;
}
.font-detail-back:hover { color: #fff; }
.font-detail-back i { font-size: 0.8rem; }
.font-detail-header { padding: 8px 24px 40px; text-align: center; }
.fd-title-ar {
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  font-weight: 900; color: #fff; line-height: 1.05; margin-bottom: 4px;
  text-align: center;
  /* font-family injected inline per font */
}
.fd-title-en {
  font-size: 1rem; color: var(--muted2);
  font-family: var(--font-med); font-weight: 500;
  direction: ltr; text-align: center; margin-bottom: 28px;
}
.fd-descriptions {
  display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--border2); padding-top: 22px;
}
.fd-desc {
  font-family: var(--font-med); font-weight: 500;
  font-size: 0.95rem; color: rgba(255,255,255,0.52); line-height: 1.85; max-width: 760px;
}
.fd-desc-en { direction: ltr; text-align: left; color: rgba(255,255,255,0.32); font-size: 0.95rem; }

.fd-images { display: flex; flex-direction: column; gap: 0; width: 100%; margin-top: 40px; }
.fd-image-item { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #0a0a0a; }
.fd-image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.fd-weights-section { padding: 36px 24px 0; }
.fd-weights-text {
  font-family: var(--font-med); font-weight: 500;
  font-size: 1rem; color: var(--muted2); direction: rtl;
  border-top: 1px solid var(--border2); padding-top: 28px;
}
.fd-weights-label {
  display: block; font-size: 0.78rem; color: rgba(255,255,255,0.35);
  font-family: var(--font-med); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 14px;
}
.fd-weights-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.fd-weight-tag {
  font-size: 0.9rem; color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 6px 16px;
  font-family: var(--font-med); font-weight: 500;
  transition: background 0.18s, border-color 0.18s;
}
.fd-weight-tag:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
.fd-download-wrap { padding: 36px 24px 0; }
.fd-download-btn { display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; padding: 14px 36px; border-radius: 8px; }

/* ── FONT DETAIL PRICING ── */
.fd-pricing-section {
  padding: 32px 24px 0; direction: rtl;
}
.fd-pricing-inner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--border2); padding-top: 24px;
  margin-bottom: 20px;
}
.fd-price-large {
  font-family: var(--font-black); font-weight: 900; font-size: 1.1rem;
  padding: 6px 18px; border-radius: 24px;
}
.fd-price-large.free { color: #4ade80; border: 1px solid rgba(74,222,128,0.35); background: rgba(74,222,128,0.06); }
.fd-price-large.paid { color: #facc15; border: 1px solid rgba(250,204,21,0.35); background: rgba(250,204,21,0.06); }
.fd-license-row {
  font-family: var(--font-med); font-weight: 500; font-size: 0.88rem;
  color: var(--muted2);
}
.fd-license-row strong { color: rgba(255,255,255,0.7); font-family: var(--font-black); font-weight: 900; }
.fd-weight-cats {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.fd-wcat {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 16px; min-width: 140px;
}
.fd-wcat-label {
  font-size: 0.75rem; color: var(--muted2); font-family: var(--font-med);
  font-weight: 500; margin-bottom: 6px; direction: rtl;
}
.fd-wcat-label.free { color: #4ade80; }
.fd-wcat-label.paid { color: #facc15; }
.fd-wcat-items {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.fd-wcat-tag {
  font-size: 0.8rem; font-family: var(--font-med); font-weight: 500;
  color: rgba(255,255,255,0.7); background: var(--bg4);
  border-radius: 6px; padding: 3px 10px;
}

/* ══════════════════════════ BUTTONS ══════════════════════════ */
.btn-white {
  background: #fff; color: #000; border: none; padding: 11px 28px;
  border-radius: 8px; font-family: var(--font-black); font-weight: 900; font-size: 0.95rem;
  cursor: pointer; transition: background 0.2s; text-decoration: none; display: inline-block;
}
.btn-white:hover { background: rgba(255,255,255,0.88); }
.btn-white.full { width: 100%; text-align: center; }
.btn-red {
  background: transparent; color: #e74c3c; border: 1px solid #e74c3c;
  padding: 8px 18px; border-radius: 6px; font-family: var(--font-med);
  font-weight: 500; font-size: 0.88rem; cursor: pointer; transition: all 0.2s;
}
.btn-red:hover { background: #e74c3c; color: #fff; }
.btn-dashed {
  background: transparent; border: 1px dashed rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5); padding: 9px 18px; border-radius: 8px;
  font-family: var(--font-med); font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s; margin-bottom: 10px;
}
.btn-dashed:hover { border-color: rgba(255,255,255,0.45); color: #fff; background: rgba(255,255,255,0.04); }

/* ══════════════════════════ MODAL ══════════════════════════ */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 700; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  backdrop-filter: blur(10px);
}
.modal-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; position: relative;
}
.modal-card h3 {
  font-family: var(--font-black); font-weight: 900;
  font-size: 1.4rem; color: #fff; text-align: center; margin-bottom: 24px;
}
.modal-card form { display: flex; flex-direction: column; gap: 14px; }
.modal-x {
  position: absolute; top: 12px; left: 12px;
  background: var(--bg4); border: 1px solid var(--border2); color: var(--muted2);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 5;
}
.modal-x:hover { background: var(--bg3); color: #fff; }

/* ══════════════════════════ INPUTS ══════════════════════════ */
input[type=text], input[type=password], input[type=url], textarea {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 12px 14px;
  color: var(--text); font-family: var(--font-med); font-weight: 500;
  font-size: 0.95rem; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: rgba(255,255,255,0.45); }
textarea { min-height: 80px; resize: vertical; }
.err { color: #e74c3c; font-size: 0.88rem; text-align: center; }

/* ══════════════════════════ ADMIN ══════════════════════════ */
#admin-panel {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 500; overflow-y: auto; padding-bottom: 40px;
}
.admin-topbar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 15px 24px; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-black); font-weight: 900; font-size: 1rem; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.admin-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--bg2); padding: 0 24px;
  position: sticky; top: 52px; z-index: 9; overflow-x: auto;
}
.atab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted2); padding: 13px 20px;
  font-family: var(--font-med); font-weight: 500; font-size: 0.92rem;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.atab:hover { color: #fff; }
.atab.active { color: #fff; border-bottom-color: #fff; }
.atab-content { max-width: 800px; margin: 28px auto; padding: 0 24px; }
.atab-content h3 { font-family: var(--font-black); font-weight: 900; color: #fff; margin-bottom: 18px; font-size: 1.15rem; }
.add-form {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px;
}
.add-form label { color: var(--muted2); font-size: 0.85rem; font-family: var(--font-med); }
.add-form input[type=file] { background: none; border: none; padding: 0; color: var(--muted2); }

.weight-file-help {
  margin-top: -4px;
  color: #9c9c9c;
  font-size: 0.76rem;
}

.weight-file-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #2d2d2d;
  background: #111;
  border-radius: 10px;
  padding: 10px;
}

.weight-file-empty {
  color: #9a9a9a;
  font-size: 0.8rem;
}

.weight-file-row {
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #151515;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.weight-file-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.weight-file-row-name {
  color: #fff;
  font-size: 0.84rem;
  font-family: var(--font-black);
}

.weight-file-row-current {
  color: #b8b8b8;
  font-size: 0.75rem;
}

.weight-file-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.weight-file-input {
  flex: 1;
}

.weight-file-clear {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.45);
  color: #f87171;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.73rem;
  cursor: pointer;
  white-space: nowrap;
}

.weight-file-clear:hover {
  background: rgba(239,68,68,0.14);
}

.edit-images-manager {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #2d2d2d;
  background: #111;
  border-radius: 10px;
  padding: 10px;
}

.edit-images-empty {
  color: #9a9a9a;
  font-size: 0.8rem;
}

.edit-image-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #151515;
}

.edit-image-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #303030;
  flex-shrink: 0;
}

.edit-image-remove {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.45);
  color: #f87171;
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 0.74rem;
  cursor: pointer;
}

.edit-image-remove:hover {
  background: rgba(239,68,68,0.14);
}
.social-editor-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  flex-wrap: nowrap;
}
.se-icon-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  color: #fff; font-size: 1.1rem; transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.se-icon-btn:hover { border-color: rgba(255,255,255,0.3); background: var(--bg3); }
.se-caret { font-size: 0.6rem; color: var(--muted2); }
.se-url { flex: 2; }
.se-name { flex: 1; min-width: 90px; max-width: 140px; }
.btn-remove { background: none; border: none; color: rgba(231,76,60,0.7); cursor: pointer; font-size: 0.9rem; padding: 6px 8px; flex-shrink: 0; transition: color 0.2s; }
.btn-remove:hover { color: #e74c3c; }

/* ══════════════════════════ ICON PICKER ══════════════════════════ */
.icon-picker-popup {
  position: absolute; z-index: 9999;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; width: 340px; max-height: 380px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.85);
  display: flex; flex-direction: column; overflow: hidden;
}
.icon-picker-popup.hidden { display: none !important; }
.ip-search-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ip-search {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 12px; color: #fff;
  font-family: var(--font-med); font-size: 0.88rem;
}
.ip-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px; padding: 10px; overflow-y: auto; flex: 1;
}
.ip-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 9px 4px; border-radius: 8px; border: none;
  background: none; color: rgba(255,255,255,0.75); cursor: pointer;
  font-size: 1.2rem; transition: background 0.15s, color 0.15s;
  min-width: 0;
}
.ip-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ip-label {
  font-size: 0.55rem; font-family: var(--font-med);
  color: rgba(255,255,255,0.4); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  width: 100%; line-height: 1.2;
}
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px;
  display: flex; align-items: center; gap: 12px;
}
.admin-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.admin-item-info { flex: 1; }
.admin-item-info h4 { font-size: 0.9rem; margin-bottom: 3px; font-family: var(--font-black); font-weight: 900; }
.admin-item-info p { font-size: 0.78rem; color: var(--muted2); font-family: var(--font-med); }
.btn-del {
  background: none; border: 1px solid rgba(231,76,60,0.45); color: #e74c3c;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  font-family: var(--font-med); font-size: 0.82rem; transition: all 0.2s; flex-shrink: 0;
}
.btn-del:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-edit {
  background: none; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.65);
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  font-family: var(--font-med); font-size: 0.82rem; transition: all 0.2s; flex-shrink: 0;
}
.btn-edit:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.5); }

/* ══════════════════════════ STATS ══════════════════════════ */
.stats-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 36px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 28px 24px; text-align: center;
}
.stat-num {
  font-family: var(--font-black); font-weight: 900;
  font-size: 3rem; color: #fff; line-height: 1; margin-bottom: 8px;
}
.stat-label {
  font-family: var(--font-med); font-weight: 500;
  font-size: 0.85rem; color: var(--muted2);
}
.stats-sub-title {
  font-family: var(--font-black); font-weight: 900;
  font-size: 1rem; color: #fff; margin-bottom: 14px;
}
.stats-fonts-list { display: flex; flex-direction: column; gap: 8px; }
.stats-font-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 16px;
}
.stats-font-name {
  font-family: var(--font-black); font-weight: 900;
  font-size: 0.92rem; color: #fff;
}
.stats-font-en {
  font-family: var(--font-med); font-weight: 500;
  font-size: 0.78rem; color: var(--muted2); direction: ltr;
}
.stats-font-count {
  font-family: var(--font-black); font-weight: 900;
  font-size: 1.1rem; color: #fff; flex-shrink: 0;
  background: rgba(255,255,255,0.07); border-radius: 8px;
  padding: 4px 14px; font-size: 0.88rem;
}
.stats-refresh-btn {
  margin-bottom: 20px; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border2); color: var(--muted2);
  padding: 8px 16px; border-radius: 8px; font-family: var(--font-med);
  font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.stats-refresh-btn:hover { border-color: #fff; color: #fff; }

/* ══════════════════════════ SCROLLBAR ══════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ══════════════════════════ RESPONSIVE ══════════════════════════ */
@media (max-width: 768px) {
  .sec-inner { padding: 30px 16px 40px; }
  .home-title { font-size: 2.6rem; }
  .fonts-grid { grid-template-columns: 1fr; }
  .font-card-name { font-size: 2.4rem; }
  .fd-title-ar { font-size: 3rem; }
  .stats-cards { grid-template-columns: 1fr; }
}

/* ══════════════════════════ PROFESSIONAL REFRESH ══════════════════════════ */
:root {
  --bg: #f8f4eb;
  --bg2: #fffaf1;
  --bg3: #f3ebde;
  --bg4: #eadecb;
  --text: #201a14;
  --muted: #ad9b82;
  --muted2: #6d5f4b;
  --border: #e5d8c5;
  --border2: #dbc8ad;
  --accent: #c56a44;
  --accent-2: #1f7a72;
  --font-black: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
  --font-med: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, #fbf7f0 0%, #f4eadc 52%, #faf7ef 100%);
  min-height: 100vh;
}

body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 0;
  filter: none;
}

body::before {
  inset: 0;
  background:
    radial-gradient(1200px 620px at 14% -10%, rgba(197,106,68,0.2), transparent 58%),
    radial-gradient(980px 560px at 88% 8%, rgba(31,122,114,0.16), transparent 56%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 2px, rgba(255,255,255,0) 2px 10px);
  opacity: 0.75;
}

body::after {
  display: none;
}

#app,
#admin-panel,
#drawer,
#topbar,
#splash {
  position: relative;
  z-index: 1;
}

#splash {
  background:
    radial-gradient(640px 280px at 50% 0%, rgba(197,106,68,0.22), transparent 72%),
    linear-gradient(165deg, #2d2118 0%, #1d150f 58%, #25180f 100%);
}

#splash-logo {
  border: 2px solid rgba(255,255,255,0.38);
  filter: none;
}

.splash-name,
.splash-sub {
  color: #fff8ea;
}

.splash-sub {
  font-family: var(--font-latin);
  letter-spacing: 0.05em;
  color: rgba(255,248,234,0.72);
}

#topbar {
  justify-content: flex-start;
  gap: 10px;
  background: rgba(255,250,241,0.84);
  border-bottom: 1px solid var(--border2);
  box-shadow: 0 12px 30px rgba(82,60,36,0.12);
}

#menu-toggle {
  order: 3;
  margin-inline-start: 0;
  color: var(--text);
}

#topbar-logo { order: 1; }

#menu-toggle:hover {
  background: rgba(197,106,68,0.14);
}

#topbar-logo {
  border: 1px solid rgba(197,106,68,0.35);
  filter: none;
  box-shadow: 0 6px 18px rgba(197,106,68,0.22);
}

#drawer-overlay {
  background: rgba(20,14,10,0.45);
}

#drawer {
  background: #fffaf2;
  box-shadow: -12px 0 45px rgba(40,27,16,0.22);
}

.drawer-header {
  border-bottom: 1px solid var(--border);
}

.drawer-title {
  color: var(--text);
}

#drawer-close {
  color: var(--muted2);
}

#drawer-close:hover {
  background: var(--bg4);
  color: var(--text);
}

.drawer-item {
  color: #735f48;
}

.drawer-item:hover {
  background: rgba(197,106,68,0.11);
  color: var(--text);
}

.drawer-item.active {
  background: rgba(31,122,114,0.12);
  color: #134f4b;
  border-right: 3px solid var(--accent-2);
}

#sec-home {
  background: transparent;
}

.home-hero {
  padding: 66px 24px 42px;
}

.home-logo-wrap {
  width: 170px;
  height: 170px;
}

.home-logo {
  filter: none;
  border: 2px solid rgba(197,106,68,0.34);
  box-shadow: 0 18px 45px rgba(109,74,46,0.28);
}

.home-ring {
  border: 1px solid rgba(197,106,68,0.4);
}

.home-ring::after {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(197,106,68,0.5);
}

.home-title {
  color: #2a1e13;
  text-shadow: 0 8px 18px rgba(180,120,72,0.22);
}

.home-sub {
  font-family: var(--font-latin);
  letter-spacing: 0.08em;
  color: #826e57;
}

.home-slider-wrap {
  margin: 0 14px;
  border: 1px solid var(--border2);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(72,51,33,0.15);
}

.home-slide img {
  filter: saturate(1.08) contrast(1.02) brightness(0.9);
}

.home-slide:hover img {
  filter: saturate(1.16) contrast(1.04) brightness(0.98);
}

.home-slide-label {
  background: linear-gradient(to top, rgba(20,13,8,0.72) 0%, rgba(20,13,8,0.18) 62%, transparent 100%);
}

.slider-arrow {
  background: rgba(255,250,241,0.88);
  color: #443122;
  border: 1px solid rgba(197,106,68,0.36);
}

.slider-arrow:hover {
  background: #fff2e2;
  color: #2c1d11;
}

.slider-dot {
  background: rgba(109,95,75,0.3);
}

.slider-dot.active {
  background: var(--accent);
}

.slider-counter {
  color: #7e6951;
  font-family: var(--font-latin);
}

.home-search-wrap {
  padding: 28px 14px 0;
}

.home-search-box {
  background: rgba(255,252,245,0.95);
  border: 1px solid var(--border2);
  box-shadow: 0 12px 28px rgba(79,57,36,0.11);
}

.home-search-box:focus-within {
  border-color: rgba(197,106,68,0.6);
  box-shadow: 0 0 0 3px rgba(197,106,68,0.16), 0 10px 26px rgba(88,61,37,0.2);
}

#font-search {
  color: var(--text);
}

#font-search::placeholder {
  color: #9f907d;
}

.search-suggestions {
  background: #fffaf1;
  border: 1px solid var(--border2);
  box-shadow: 0 12px 25px rgba(67,45,26,0.16);
}

.suggestion-item {
  border-bottom: 1px solid var(--border);
}

.suggestion-item:hover {
  background: rgba(31,122,114,0.09);
}

.sug-ar {
  color: var(--text);
}

.sug-en {
  color: #7a6a56;
  font-family: var(--font-latin);
}

.fonts-grid {
  background: transparent;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 22px 14px 34px;
}

.font-card {
  background: linear-gradient(170deg, #fffdf8 0%, #f6ecde 100%);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(85,61,38,0.14);
}

.font-card:hover {
  background: linear-gradient(170deg, #fffdf7 0%, #f1dfca 100%);
}

.font-card:focus-visible {
  outline: 3px solid rgba(31,122,114,0.45);
  outline-offset: 2px;
}

.font-card-footer {
  border-top: 1px solid rgba(122,102,79,0.2);
}

.font-card-ar {
  color: #2a1d12;
}

.font-card-en {
  color: #6c5f4d;
}

.weight-tag {
  color: #614f3d;
  background: rgba(255,255,255,0.62);
  border-color: rgba(137,110,81,0.28);
}

.font-card-arrow {
  color: #8f7960;
}

.badge-free {
  color: #14675f;
  border-color: rgba(20,103,95,0.32);
  background: rgba(20,103,95,0.08);
}

.badge-paid {
  color: #9a5a25;
  border-color: rgba(154,90,37,0.32);
  background: rgba(154,90,37,0.08);
}

.accounts-group {
  border-bottom: 1px solid var(--border);
}

.accounts-group-title {
  color: #8b7a66;
}

.social-row-card {
  background: rgba(255,251,243,0.95);
  border: 1px solid var(--border2);
  box-shadow: 0 10px 24px rgba(66,45,27,0.11);
}

.social-row-card:hover {
  border-color: rgba(31,122,114,0.44);
  background: #fff6ea;
  box-shadow: 0 14px 30px rgba(42,74,71,0.18);
}

.src-icon {
  color: #3c2c1e;
}

#sec-font-detail {
  background: transparent;
}

.fd-title-ar {
  color: #271b12;
}

.fd-title-en {
  color: #7b6954;
  font-family: var(--font-latin);
}

.fd-desc {
  color: #5d4f40;
}

.fd-desc-en {
  color: #7d6f5c;
  font-family: var(--font-latin);
}

.fd-image-item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border2);
  margin: 0 12px;
}

.btn-white {
  background: linear-gradient(135deg, #1f7a72 0%, #16645f 100%);
  color: #f7f6f2;
  box-shadow: 0 12px 24px rgba(18,88,82,0.34);
}

.btn-white:hover {
  background: linear-gradient(135deg, #24887f 0%, #1a716a 100%);
}

.runtime-badge {
  order: 2;
  margin-inline-start: auto;
  font-family: var(--font-latin);
  font-size: 0.72rem;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.runtime-badge.live {
  background: rgba(31,122,114,0.12);
  color: #13544d;
  border-color: rgba(31,122,114,0.3);
}

.runtime-badge.readonly {
  background: rgba(197,106,68,0.13);
  color: #7f3f20;
  border-color: rgba(197,106,68,0.34);
}

body.readonly-mode #topbar-logo {
  cursor: not-allowed;
  opacity: 0.8;
}

@media (max-width: 900px) {
  .home-slider-wrap {
    margin: 0 10px;
  }

  .fonts-grid {
    padding: 18px 10px 26px;
    grid-template-columns: 1fr;
  }

  .runtime-badge {
    font-size: 0.65rem;
    padding: 5px 9px;
  }
}

/* ══════════════════════════ TYPE DESIGNER UPGRADE ══════════════════════════ */
.home-lead {
  max-width: 740px;
  margin-top: 2px;
  color: #6b5a47;
  font-size: clamp(0.96rem, 2vw, 1.12rem);
  line-height: 1.85;
}

.home-metrics {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-card {
  border: 1px solid rgba(197,106,68,0.25);
  background: rgba(255,250,240,0.72);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  box-shadow: 0 8px 18px rgba(105,74,48,0.11);
}

.metric-num {
  font-family: var(--font-black);
  font-size: 1.8rem;
  color: #2d1e13;
  line-height: 1;
}

.metric-label {
  color: #7a6854;
  margin-top: 8px;
  font-size: 0.84rem;
}

.home-fonts-section {
  padding: 20px 0 0;
}

.home-fonts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 12px;
}

.home-fonts-title {
  font-family: var(--font-black);
  color: #2a1c11;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.home-fonts-sub {
  color: #766450;
  margin-top: 2px;
  font-size: 0.9rem;
}

.home-random-btn {
  border: 1px solid rgba(31,122,114,0.42);
  background: rgba(31,122,114,0.1);
  color: #155c55;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-med);
  font-size: 0.88rem;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.home-random-btn:hover {
  background: rgba(31,122,114,0.17);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(21,92,85,0.18);
}

.social-row-card {
  justify-content: space-between;
  min-height: 78px;
  height: auto;
  padding: 14px 16px;
  gap: 12px;
}

.src-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.src-title {
  font-family: var(--font-black);
  color: #2b1f13;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-url {
  color: #7b6b57;
  font-size: 0.78rem;
  font-family: var(--font-latin);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.src-arrow {
  color: #8f7f6a;
  font-size: 0.85rem;
}

.font-card {
  overflow: hidden;
}

.font-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(122,102,79,0.18);
}

.font-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.4s ease;
  filter: saturate(1.08) contrast(1.03);
}

.font-card:hover .font-card-media img {
  transform: scale(1.03);
  filter: saturate(1.14) contrast(1.06);
}

.font-card-poster-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(14,13,11,0.7);
  color: #f8f1e6;
  border: 1px solid rgba(255,255,255,0.24);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: var(--font-latin);
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.font-card-body {
  padding: 16px 18px 12px;
}

.font-card-stats {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #7c6b56;
  font-size: 0.78rem;
}

.font-card-stats span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(137,110,81,0.22);
}

.fd-images {
  margin-top: 28px;
  padding: 0 12px;
}

.fd-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.fd-shot {
  grid-column: span 6;
  position: relative;
  border: none;
  background: #1f1a14;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
  box-shadow: 0 14px 30px rgba(28,20,14,0.18);
}

.fd-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.4s ease;
}

.fd-shot:hover img {
  transform: scale(1.04);
  filter: saturate(1.08);
}

.fd-shot:focus-visible {
  outline: 3px solid rgba(31,122,114,0.55);
  outline-offset: 2px;
}

.fd-shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,10,7,0.46), transparent 52%);
}

.fd-shot-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  background: rgba(255,250,241,0.86);
  color: #23160e;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-family: var(--font-latin);
}

.fd-shot-hero {
  grid-column: span 12;
  aspect-ratio: 16 / 8;
}

.fd-shot-wide {
  grid-column: span 8;
}

.fd-shot-tall {
  grid-column: span 4;
  aspect-ratio: 4 / 5;
}

.fd-gallery-empty {
  text-align: center;
  padding: 26px 18px;
  color: #7a6955;
  border: 1px dashed rgba(122,102,79,0.35);
  background: rgba(255,250,241,0.7);
  border-radius: 12px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15,11,8,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px;
  backdrop-filter: blur(10px);
}

.image-viewer.hidden {
  display: none !important;
}

.image-viewer-stage {
  width: min(1120px, 100%);
  max-height: 88vh;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  background: #15100c;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.image-viewer-stage img {
  width: 100%;
  max-height: calc(88vh - 50px);
  object-fit: cover;
  display: block;
}

#image-viewer-caption {
  color: rgba(255,244,226,0.85);
  font-family: var(--font-latin);
  font-size: 0.85rem;
  padding: 9px 14px;
  background: rgba(0,0,0,0.28);
}

.image-viewer-close,
.image-viewer-nav {
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(255,250,241,0.13);
  color: #fff8ec;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  left: 20px;
}

.image-viewer-close:hover,
.image-viewer-nav:hover {
  background: rgba(255,250,241,0.24);
  transform: scale(1.05);
}

.no-scroll {
  overflow: hidden;
}

@media (max-width: 900px) {
  .home-metrics {
    grid-template-columns: 1fr;
  }

  .home-fonts-head {
    flex-direction: column;
    align-items: stretch;
  }

  .home-random-btn {
    justify-content: center;
  }

  .fd-shot,
  .fd-shot-wide,
  .fd-shot-tall,
  .fd-shot-hero {
    grid-column: span 12;
    aspect-ratio: 16 / 10;
  }

  .image-viewer {
    padding: 16px;
  }

  .image-viewer-nav {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .image-viewer-close {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  body.lang-ltr .image-viewer-close {
    right: 12px;
    left: auto;
  }
}

/* ══════════════════════════ SETTINGS + THEMES ══════════════════════════ */
#settings-btn {
  order: 3;
  background: rgba(197,106,68,0.12);
  border: 1px solid rgba(197,106,68,0.34);
  color: #5d3b20;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

#settings-btn:hover {
  background: rgba(197,106,68,0.2);
  border-color: rgba(197,106,68,0.5);
  transform: rotate(12deg);
}

#menu-toggle {
  order: 4;
}

.settings-card {
  max-width: 480px;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-grid label {
  color: var(--muted2);
  font-size: 0.88rem;
  font-family: var(--font-med);
}

select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-med);
  font-size: 0.95rem;
  padding: 11px 14px;
}

select:focus {
  outline: none;
  border-color: rgba(31,122,114,0.45);
}

body.lang-ltr {
  direction: ltr;
}

body.lang-ltr .drawer-item {
  direction: ltr;
  text-align: left;
  justify-content: flex-start;
}

body.lang-ltr .home-slide-label,
body.lang-ltr .font-card-preview,
body.lang-ltr .font-card-stats,
body.lang-ltr .font-card-footer,
body.lang-ltr .src-meta,
body.lang-ltr .fd-weights-text,
body.lang-ltr .fd-pricing-section {
  direction: ltr;
}

body.lang-ltr .slider-arrow-prev {
  left: 20px;
  right: auto;
}

body.lang-ltr .slider-arrow-next {
  right: 20px;
  left: auto;
}

body.lang-ltr .image-viewer-close {
  right: 20px;
  left: auto;
}

/* Keep overlay blur behind opened drawer */
#drawer-overlay {
  z-index: 260;
}

#drawer {
  z-index: 320;
}

/* Legendary splash */
#splash {
  overflow: hidden;
}

.splash-aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(circle at 30% 40%, rgba(215,126,82,0.38), transparent 45%),
    radial-gradient(circle at 70% 58%, rgba(70,170,162,0.34), transparent 46%),
    radial-gradient(circle at 50% 25%, rgba(255,255,255,0.14), transparent 46%);
  animation: auroraMove 8.5s ease-in-out infinite alternate;
}

.splash-logo-shell {
  width: 176px;
  height: 176px;
  --splash-orbit-inset: 7px;
  --splash-orbit-dot-size: 12px;
  --splash-orbit-radius: calc((100% - (var(--splash-orbit-inset) * 2)) / 2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashFloat 3.2s ease-in-out infinite;
}

#splash-logo {
  width: 132px;
  height: 132px;
  border: 2px solid rgba(255,255,255,0.56);
  box-shadow: 0 0 0 8px rgba(255,255,255,0.09), 0 24px 50px rgba(0,0,0,0.4);
  position: relative;
  z-index: 2;
}

.splash-orbit-ring {
  position: absolute;
  inset: var(--splash-orbit-inset);
  border-radius: 50%;
  border: 1.2px dashed rgba(255,255,255,0.3);
  animation: splashRingRotate 10s linear infinite;
}

.splash-orbit-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--splash-orbit-dot-size);
  height: var(--splash-orbit-dot-size);
  margin: calc(var(--splash-orbit-dot-size) / -2);
  border-radius: 50%;
  background: #fff7e8;
  box-shadow: 0 0 12px rgba(255,255,255,0.8);
  transform: rotate(0deg) translateX(var(--splash-orbit-radius));
  animation: splashDotOrbit 2.9s linear infinite;
}

.splash-name {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  text-shadow: 0 8px 20px rgba(0,0,0,0.35);
  animation: splashNameIn 1.2s ease both;
}

.splash-sub {
  animation: splashSubIn 1.4s ease 0.35s both;
}

@keyframes splashDotOrbit {
  to {
    transform: rotate(360deg) translateX(var(--splash-orbit-radius));
  }
}

@keyframes splashRingRotate {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes auroraMove {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(12deg) scale(1.08); }
}

@keyframes splashNameIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splashSubIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark theme */
:root[data-theme='dark'] {
  --bg: #0f1218;
  --bg2: #171c24;
  --bg3: #1f2530;
  --bg4: #2a3240;
  --text: #ecf2ff;
  --muted: #637089;
  --muted2: #9ba9c4;
  --border: #2a3343;
  --border2: #39465d;
  --accent: #c8754f;
  --accent-2: #43c0b2;
}

:root[data-theme='dark'] body {
  background:
    linear-gradient(180deg, #121722 0%, #171d2a 56%, #121926 100%);
}

:root[data-theme='dark'] body::before {
  background:
    radial-gradient(1260px 640px at 14% -10%, rgba(200,117,79,0.2), transparent 56%),
    radial-gradient(980px 560px at 88% 8%, rgba(67,192,178,0.17), transparent 54%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 2px, rgba(255,255,255,0) 2px 10px);
  opacity: 0.9;
}

:root[data-theme='dark'] #topbar {
  background: rgba(22,28,36,0.84);
  border-bottom-color: var(--border2);
  box-shadow: 0 12px 30px rgba(6,9,13,0.42);
}

:root[data-theme='dark'] #settings-btn {
  background: rgba(67,192,178,0.16);
  border-color: rgba(67,192,178,0.46);
  color: #9ee5dc;
}

:root[data-theme='dark'] #menu-toggle,
:root[data-theme='dark'] #topbar-logo,
:root[data-theme='dark'] .drawer-title,
:root[data-theme='dark'] .home-title,
:root[data-theme='dark'] .home-fonts-title,
:root[data-theme='dark'] .src-title,
:root[data-theme='dark'] .font-card-ar,
:root[data-theme='dark'] .fd-title-ar {
  color: var(--text);
}

:root[data-theme='dark'] #drawer,
:root[data-theme='dark'] .home-slider-wrap,
:root[data-theme='dark'] .home-search-box,
:root[data-theme='dark'] .metric-card,
:root[data-theme='dark'] .social-row-card,
:root[data-theme='dark'] .font-card,
:root[data-theme='dark'] .fd-shot,
:root[data-theme='dark'] .fd-gallery-empty,
:root[data-theme='dark'] .settings-card,
:root[data-theme='dark'] .modal-card,
:root[data-theme='dark'] .admin-item,
:root[data-theme='dark'] .stats-font-row,
:root[data-theme='dark'] .stat-card {
  background: var(--bg2);
  border-color: var(--border2);
}

:root[data-theme='dark'] .font-card {
  background: linear-gradient(170deg, #171c24 0%, #1d2330 100%);
}

:root[data-theme='dark'] .font-card:hover {
  background: linear-gradient(170deg, #1d2430 0%, #222a39 100%);
}

:root[data-theme='dark'] .home-sub,
:root[data-theme='dark'] .home-lead,
:root[data-theme='dark'] .home-fonts-sub,
:root[data-theme='dark'] .src-url,
:root[data-theme='dark'] .font-card-en,
:root[data-theme='dark'] .fd-desc,
:root[data-theme='dark'] .fd-desc-en,
:root[data-theme='dark'] .metric-label {
  color: #a7b4ce;
}

:root[data-theme='dark'] .badge-free {
  color: #8ce7de;
  border-color: rgba(67,192,178,0.35);
  background: rgba(67,192,178,0.15);
}

:root[data-theme='dark'] .badge-paid {
  color: #f0be9f;
  border-color: rgba(200,117,79,0.36);
  background: rgba(200,117,79,0.16);
}

:root[data-theme='dark'] .btn-white {
  background: linear-gradient(135deg, #43c0b2 0%, #2e8f84 100%);
  color: #071310;
}

:root[data-theme='dark'] .runtime-badge.readonly {
  background: rgba(200,117,79,0.2);
  color: #f1b694;
  border-color: rgba(200,117,79,0.42);
}

:root[data-theme='dark'] .runtime-badge.live {
  background: rgba(67,192,178,0.16);
  color: #9fe6dd;
  border-color: rgba(67,192,178,0.42);
}

/* ══════════════════════════ FINAL POLISH ══════════════════════════ */
#topbar {
  gap: 8px;
  padding-inline: 12px;
  flex-wrap: nowrap;
}

#runtime-badge {
  margin-inline-start: auto;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-chip {
  order: 2;
  border: 1px solid rgba(31,122,114,0.28);
  background: rgba(31,122,114,0.1);
  color: #13554e;
  font-family: var(--font-latin);
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-name-card {
  max-width: 470px;
}

.download-name-note {
  color: var(--muted2);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.7;
}

.download-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-ghost {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted2);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-med);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: rgba(197,106,68,0.45);
  color: var(--text);
  background: rgba(197,106,68,0.08);
}

#download-name-confirm {
  flex: 1;
}

.fd-usage-stats {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.fd-usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31,122,114,0.28);
  background: rgba(31,122,114,0.08);
  color: #165c55;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: var(--font-latin);
}

.stats-insights {
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-kpi-item {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
}

.stats-kpi-label {
  display: block;
  color: var(--muted2);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.stats-kpi-value {
  display: block;
  color: var(--text);
  font-family: var(--font-black);
  font-size: 1.02rem;
}

.stats-recent-wrap {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px;
}

.stats-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.34);
  border: 1px solid rgba(124,107,86,0.22);
  border-radius: 9px;
  padding: 8px 10px;
}

.stats-recent-name {
  font-family: var(--font-black);
  color: var(--text);
  font-size: 0.85rem;
}

.stats-recent-font {
  color: var(--muted2);
  font-size: 0.8rem;
}

.stats-recent-empty {
  color: var(--muted2);
  font-size: 0.84rem;
}

body[data-page='loading'] {
  min-height: 100dvh;
  overflow: hidden;
}

body[data-page='loading']::before,
body[data-page='loading']::after {
  display: none;
}

body[data-page='loading'] #splash {
  min-height: 100dvh;
  width: 100vw;
}

@media (max-width: 900px) {
  #runtime-badge {
    max-width: 34vw;
    font-size: 0.64rem;
  }

  .topbar-user-chip {
    max-width: 24vw;
    font-size: 0.63rem;
    padding: 4px 8px;
  }

  .stats-kpi-grid {
    grid-template-columns: 1fr;
  }

  .download-actions {
    flex-direction: column;
  }
}

:root[data-theme='dark'] .topbar-user-chip {
  color: #9ce4da;
  border-color: rgba(67,192,178,0.4);
  background: rgba(67,192,178,0.12);
}

:root[data-theme='dark'] .fd-usage-pill {
  color: #a5ebe2;
  border-color: rgba(67,192,178,0.38);
  background: rgba(67,192,178,0.12);
}

:root[data-theme='dark'] .stats-recent-row {
  background: rgba(19,25,33,0.7);
  border-color: rgba(112,132,166,0.3);
}

/* ══════════════════════════ UI STABILITY FIXES ══════════════════════════ */
html,
body {
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.broken-image {
  opacity: 0.92;
  object-fit: cover !important;
  padding: 6px;
  background: #f4ece0;
}

#topbar {
  min-height: var(--topbar);
  align-items: center;
}

#menu-toggle,
#topbar-logo {
  flex-shrink: 0;
}

#runtime-badge,
.topbar-user-chip {
  min-width: 0;
}

.drawer-item {
  min-height: 46px;
}

.drawer-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-title {
  font-size: clamp(2rem, 7.2vw, 3.6rem);
  line-height: 1.2;
}

.home-lead {
  text-align: center;
  text-wrap: pretty;
  margin-inline: auto;
}

.font-card {
  min-height: 100%;
}

.font-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
}

.font-card-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3px;
  text-align: right;
}

body.lang-rtl .font-card-preview {
  text-align: right;
  align-items: flex-start;
}

.font-card-ar,
.font-card-en {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-card-en {
  font-size: 0.86rem;
}

body.lang-ltr .font-card-preview {
  text-align: left;
}

body.lang-ltr .src-meta,
body.lang-ltr .src-url {
  text-align: left;
}

.font-card-stats {
  margin-top: auto;
  row-gap: 8px;
  column-gap: 8px;
}

.font-card-stats span {
  max-width: 100%;
}

.font-card-footer {
  margin-top: auto;
}

.social-grid {
  gap: 10px;
}

.social-row-card {
  align-items: center;
}

.src-meta,
.src-title,
.src-url {
  min-width: 0;
}

.src-url {
  direction: ltr;
  unicode-bidi: plaintext;
}

.fd-desc,
.fd-desc-en {
  margin-inline: auto;
  text-wrap: pretty;
}

.settings-card,
.modal-card {
  max-height: min(90vh, 760px);
  overflow: auto;
}

#home-fonts-empty,
.links-empty,
.fd-gallery-empty {
  text-wrap: balance;
}

@media (max-width: 640px) {
  #runtime-badge {
    display: none;
  }

  #topbar {
    gap: 6px;
    padding-inline: 10px;
  }

  .topbar-user-chip {
    max-width: 46vw;
    font-size: 0.62rem;
  }

  .home-hero {
    padding: 54px 14px 28px;
  }

  .home-title {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }

  .home-sub {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
  }

  .home-lead {
    font-size: 0.92rem;
    line-height: 1.75;
    padding-inline: 2px;
  }

  .home-search-wrap {
    padding: 16px 10px 0;
  }

  .font-card-body {
    min-height: 122px;
    padding: 12px 12px 10px;
  }

  .font-card-stats span {
    font-size: 0.72rem;
    padding: 3px 6px;
  }

  .font-card-poster-count {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .fd-images {
    padding: 0 8px;
  }

  .fd-gallery {
    gap: 8px;
  }

  .fd-shot,
  .fd-shot-wide,
  .fd-shot-tall,
  .fd-shot-hero {
    aspect-ratio: 16 / 11;
  }

  .modal-card {
    padding: 24px 16px;
  }
}

:root[data-theme='dark'] .broken-image {
  background: #1a2230;
  opacity: 0.86;
}

/* ══════════════════════════ USER VISUAL REFINEMENT ══════════════════════════ */
:root {
  --font-black: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
  --font-med: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif;
}

body,
button,
input,
select,
textarea,
.loading-tag {
  font-family: 'Geeza Web', 'Geeza Pro', 'Geeza', 'Segoe UI', Tahoma, sans-serif !important;
  font-weight: 400;
}

h1,
h2,
h3,
.home-title,
.home-fonts-title,
.sec-title,
.drawer-title,
.fd-title-ar,
.admin-topbar,
.stats-sub-title,
.font-card-ar,
.src-title,
.fd-price-large,
.btn-white {
  font-weight: 700;
}

.home-sub,
.home-lead,
.home-fonts-sub,
.src-url,
.font-card-en,
.font-card-stats,
.drawer-item,
.fd-license-row,
.metric-label,
.weight-tag {
  font-weight: 500;
}

#home-metrics,
.home-metrics {
  display: none !important;
}

.font-card {
  border-radius: 22px;
  border: 1px solid rgba(122, 93, 63, 0.26);
  box-shadow: 0 10px 24px rgba(81, 58, 37, 0.12);
}

.font-card-media {
  aspect-ratio: 5 / 4;
}

.font-card-media img {
  object-fit: cover;
}

.font-card-body {
  padding: 14px 14px 12px;
  min-height: 118px;
}

.font-card-preview {
  gap: 4px;
}

.font-card-ar {
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
}

.font-card-en {
  font-size: 0.84rem;
}

.font-card-stats {
  gap: 6px;
}

.font-card-stats span {
  font-size: 0.74rem;
  padding: 3px 8px;
}

.weight-tag {
  border-radius: 999px;
  padding: 4px 10px;
}

.fd-images {
  margin-top: 22px;
  padding: 0 14px;
}

.fd-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.fd-shot,
.fd-shot-hero,
.fd-shot-wide,
.fd-shot-tall {
  grid-column: auto !important;
  aspect-ratio: 4 / 3;
  max-height: 290px;
  border-radius: 14px;
  overflow: hidden;
}

.fd-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-viewer-stage {
  width: min(860px, 94vw);
  max-height: 80vh;
}

.image-viewer-stage img {
  max-height: calc(80vh - 46px);
}

#settings-modal {
  padding: 16px;
}

#settings-modal .settings-card {
  width: min(560px, 96vw);
  max-height: min(88vh, 720px);
  padding: 48px 20px 20px;
  overflow: auto;
}

#settings-modal .modal-x {
  top: 10px;
  left: 10px;
}

.settings-grid {
  gap: 12px;
}

.settings-grid label {
  display: block;
  margin-bottom: 4px;
  line-height: 1.55;
}

#settings-modal select,
#settings-modal input {
  min-height: 46px;
}

.drawer-nav {
  gap: 6px;
}

.drawer-item {
  min-height: 50px;
}

body[data-page='loading'] #splash {
  background:
    radial-gradient(540px 260px at 50% -6%, rgba(208, 136, 89, 0.34), transparent 68%),
    linear-gradient(165deg, #2f2218 0%, #261a12 58%, #1e140d 100%);
}

body[data-page='loading'] .splash-name {
  color: #fff2de;
}

body[data-page='loading'] .splash-sub {
  color: rgba(255, 242, 222, 0.74);
}

@media (max-width: 900px) {
  .fd-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fd-gallery {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fd-shot,
  .fd-shot-hero,
  .fd-shot-wide,
  .fd-shot-tall {
    max-height: none;
    aspect-ratio: 4 / 3;
  }

  .font-card-media {
    aspect-ratio: 16 / 11;
  }
}

/* ══════════════════════════ DARK ONLY COMPACT FIX ══════════════════════════ */
:root,
:root[data-theme='light'],
:root[data-theme='dark'] {
  --bg: #070707;
  --bg2: #0f0f0f;
  --bg3: #151515;
  --bg4: #1d1d1d;
  --text: #f5f5f5;
  --muted: #7b7b7b;
  --muted2: #afafaf;
  --border: #212121;
  --border2: #2b2b2b;
  --accent: #f0f0f0;
  --accent-2: #d8d8d8;
}

html,
body {
  background: #070707 !important;
  color: #f5f5f5;
}

body::before,
body::after {
  display: none !important;
}

#topbar,
#drawer,
.home-slider-wrap,
.home-search-box,
.font-card,
.social-row-card,
.fd-shot,
.fd-gallery-empty,
.settings-card,
.modal-card,
.admin-item,
.stat-card,
.stats-font-row,
.stats-kpi-item,
.stats-recent-wrap,
.stats-recent-row,
.fd-wcat {
  background: #0f0f0f !important;
  border-color: #2b2b2b !important;
  color: #f5f5f5;
}

#topbar {
  box-shadow: none;
}

.home-hero {
  padding: 26px 12px 14px !important;
  gap: 10px;
}

.home-logo-wrap {
  width: 138px;
  height: 138px;
}

.home-title {
  text-shadow: none;
  margin-bottom: 2px;
}

.home-lead {
  max-width: 760px;
  margin-top: 0;
  line-height: 1.65;
}

.home-slider-wrap {
  margin: 0 auto 8px !important;
  width: min(1040px, calc(100% - 18px));
}

.home-slider {
  padding-top: 0 !important;
  height: clamp(210px, 42vw, 420px);
}

.home-slide img {
  filter: brightness(0.88) saturate(1.02);
}

.home-fonts-section {
  padding-top: 8px !important;
}

.home-fonts-head {
  padding: 0 12px 8px;
}

.fonts-grid {
  gap: 10px;
  padding: 12px 10px 20px;
}

.font-card {
  border-radius: 16px;
  box-shadow: none;
}

.font-card-media {
  aspect-ratio: 16 / 10 !important;
  max-height: 220px;
}

.font-card-body {
  min-height: 108px;
  padding: 12px;
  gap: 8px;
}

.font-card-ar {
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
}

.font-card-stats {
  gap: 6px;
}

.font-card-stats span {
  background: #1a1a1a;
  border-color: #303030;
}

.font-card-footer {
  padding: 8px 12px;
}

.sec-inner {
  padding: 22px 14px 26px !important;
}

.font-detail-header {
  padding: 2px 14px 18px;
}

.fd-title-ar {
  font-size: clamp(2.1rem, 8vw, 4.1rem);
  margin-bottom: 8px;
}

.fd-images {
  margin-top: 16px !important;
  padding: 0 10px;
}

.fd-gallery {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 8px;
}

.fd-shot,
.fd-shot-hero,
.fd-shot-wide,
.fd-shot-tall {
  grid-column: auto !important;
  aspect-ratio: 16 / 10 !important;
  max-height: 230px !important;
  box-shadow: none;
}

.fd-shot::after {
  background: linear-gradient(to top, rgba(0,0,0,0.36), transparent 58%);
}

.fd-weights-section,
.fd-pricing-section,
.fd-download-wrap {
  padding-top: 20px;
}

.image-viewer {
  padding: 14px;
  background: rgba(0,0,0,0.95);
}

.image-viewer-stage {
  width: min(760px, 92vw);
  max-height: 74vh;
}

.image-viewer-stage img {
  max-height: calc(74vh - 44px);
}

#settings-modal {
  padding: 12px;
}

#settings-modal .settings-card {
  width: min(500px, 96vw);
  padding: 42px 16px 16px;
  max-height: 86vh;
}

#settings-theme {
  opacity: 0.65;
  cursor: not-allowed;
}

body[data-page='loading'] #splash {
  background:
    radial-gradient(540px 220px at 50% -8%, rgba(255,255,255,0.12), transparent 70%),
    linear-gradient(165deg, #050505 0%, #0a0a0a 56%, #040404 100%) !important;
}

body[data-page='loading'] .splash-name {
  color: #ffffff;
}

body[data-page='loading'] .splash-sub {
  color: rgba(255,255,255,0.74);
}

.fd-descriptions {
  gap: 10px;
  padding-top: 16px;
}

.atab-content {
  margin: 18px auto;
}

@media (max-width: 900px) {
  .home-slider {
    height: clamp(190px, 54vw, 330px);
  }

  .fd-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding: 20px 10px 12px !important;
  }

  .home-slider-wrap {
    width: calc(100% - 12px);
  }

  .home-slider {
    height: clamp(170px, 56vw, 250px);
  }

  .fd-gallery {
    grid-template-columns: 1fr !important;
  }

  .fd-shot,
  .fd-shot-hero,
  .fd-shot-wide,
  .fd-shot-tall {
    max-height: none !important;
    aspect-ratio: 16 / 11 !important;
  }
}

/* ══════════════════════════ FINAL IMAGE + SPACING FIX ══════════════════════════ */
#sec-home {
  padding-top: 0 !important;
}

.home-hero {
  padding: 8px 10px 10px !important;
  gap: 8px;
}

.home-logo-wrap {
  width: 122px;
  height: 122px;
}

.home-slider-wrap {
  margin: 0 auto 6px !important;
  width: min(1020px, calc(100% - 14px));
}

.home-slider {
  height: clamp(170px, 34vw, 300px) !important;
}

.home-slide,
.font-card-media,
.fd-shot,
.fd-shot-hero,
.fd-shot-wide,
.fd-shot-tall {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  overflow: hidden;
}

.home-slide img,
.font-card-media img,
.fd-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center center;
  transform: none !important;
}

.home-slide:hover img,
.font-card:hover .font-card-media img,
.fd-shot:hover img {
  transform: none !important;
}

.font-card-media {
  aspect-ratio: 4 / 3 !important;
  max-height: 210px !important;
  padding: 8px;
}

.fonts-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

#sec-font-detail {
  min-height: auto !important;
}

.font-detail-page {
  padding-top: 4px !important;
  padding-bottom: 34px !important;
}

.font-detail-back {
  padding: 8px 12px !important;
  margin-bottom: 0 !important;
}

.font-detail-header {
  padding: 4px 12px 12px !important;
}

.fd-title-ar {
  margin-bottom: 2px;
  line-height: 1.08;
}

.fd-images {
  margin-top: 10px !important;
  padding: 0 8px;
}

.fd-gallery {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 8px;
}

.fd-shot,
.fd-shot-hero,
.fd-shot-wide,
.fd-shot-tall {
  aspect-ratio: 4 / 3 !important;
  max-height: 220px !important;
  padding: 8px;
}

.fd-shot::after {
  background: linear-gradient(to top, rgba(0,0,0,0.2), transparent 66%);
}

.fd-download-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.fd-download-actions .fd-download-btn {
  flex: 1;
  justify-content: center;
  min-width: 150px;
}

.fd-download-zip {
  background: #171717;
  border: 1px solid #2e2e2e;
  color: #f5f5f5;
  box-shadow: none;
}

.fd-download-zip:hover {
  background: #202020;
  border-color: #3a3a3a;
}

@media (max-width: 900px) {
  .home-slider {
    height: clamp(158px, 50vw, 260px) !important;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding-top: 6px !important;
  }

  body[data-page='home'] .home-logo-wrap {
    width: 108px !important;
    height: 108px !important;
  }

  .font-card-media {
    aspect-ratio: 16 / 11 !important;
    max-height: none !important;
  }

  .fd-gallery {
    grid-template-columns: 1fr !important;
  }

  .fd-shot,
  .fd-shot-hero,
  .fd-shot-wide,
  .fd-shot-tall {
    max-height: none !important;
    aspect-ratio: 16 / 11 !important;
  }

  .fd-download-actions .fd-download-btn {
    min-width: 0;
  }
}

/* ══════════════════════════ DOWNLOAD + FILTER SYSTEM ══════════════════════════ */
.font-advanced-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px 0;
}

.font-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.font-filter-item label {
  font-size: 0.74rem;
  color: #b8b8b8;
}

.font-filter-item select {
  min-height: 40px;
  background: #121212;
  border: 1px solid #2a2a2a;
  color: #f3f3f3;
  border-radius: 10px;
}

.home-download-all-btn {
  background: #171717;
  border-color: #2f2f2f;
  color: #f2f2f2;
}

.home-download-all-btn:hover {
  background: #212121;
}

.download-weights-card {
  width: min(460px, 96vw);
  max-height: min(86vh, 760px);
  padding: 46px 16px 16px;
  overflow: auto;
}

.download-weights-subtitle {
  margin-top: -8px;
  margin-bottom: 10px;
  color: #9f9f9f;
  text-align: center;
  font-size: 0.88rem;
}

.download-weights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 2px;
}

.download-weights-empty {
  color: #9c9c9c;
  text-align: center;
  padding: 14px;
}

.download-weight-btn {
  border: 1px solid #2e2e2e;
  border-radius: 11px;
  background: #151515;
  color: #f5f5f5;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.download-weight-btn:hover {
  background: #1d1d1d;
  border-color: #404040;
}

.download-weight-name {
  font-size: 0.95rem;
}

.download-weight-action {
  font-size: 0.78rem;
  color: #b6b6b6;
}

.download-weights-actions {
  margin-top: 10px;
}

/* Card equals image feel */
.font-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

.font-card-media {
  aspect-ratio: 16 / 11 !important;
  max-height: none !important;
  padding: 0 !important;
  border-bottom: none !important;
}

.font-card-media img {
  object-fit: cover !important;
  object-position: center center;
}

.font-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 2;
  min-height: 0 !important;
  padding: 10px 10px 6px !important;
  background: linear-gradient(to top, rgba(0,0,0,0.74), rgba(0,0,0,0.24), transparent);
}

.font-card-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 6px 10px !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(0,0,0,0.58);
}

.font-card-stats {
  display: none !important;
}

.font-card-ar {
  color: #f8f8f8;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.font-card-en {
  color: #d4d4d4;
}

/* Smart lazy placeholders */
@keyframes smartImgPulse {
  0% { opacity: 0.45; }
  50% { opacity: 0.75; }
  100% { opacity: 0.45; }
}

.home-slide,
.font-card-media,
.fd-shot {
  position: relative;
}

.home-slide::before,
.font-card-media::before,
.fd-shot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, #101010 0%, #181818 50%, #101010 100%);
  animation: smartImgPulse 1.2s ease-in-out infinite;
  z-index: 0;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.home-slide.is-loaded::before,
.font-card-media.is-loaded::before,
.fd-shot.is-loaded::before {
  opacity: 0;
}

.home-slide img,
.font-card-media img,
.fd-shot img {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.home-slide img.img-ready,
.font-card-media img.img-ready,
.fd-shot img.img-ready {
  opacity: 1;
}

.home-slide-label,
.font-card-poster-count,
.fd-shot-badge {
  z-index: 2;
}

@media (max-width: 920px) {
  .font-advanced-filters {
    grid-template-columns: 1fr;
    padding: 8px 10px 2px;
  }
}

/* ══════════════════════════ SMART BADGES + WEIGHT PREVIEW ══════════════════════════ */
.font-smart-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  backdrop-filter: blur(6px);
}

.font-smart-badge.new {
  background: rgba(64, 170, 117, 0.22);
  color: #a7f1c8;
  border-color: rgba(128, 229, 173, 0.42);
}

.font-smart-badge.updated {
  background: rgba(74, 149, 255, 0.2);
  color: #b7d8ff;
  border-color: rgba(123, 178, 255, 0.45);
}

.font-card-weight-previews {
  margin-top: 7px;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.font-card-weight-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 5, 5, 0.45);
  color: #e9e9e9;
  white-space: nowrap;
  min-width: max-content;
}

.font-card-weight-preview-chip strong {
  font-size: 0.7rem;
  color: #ffffff;
}

.font-card-weight-preview-chip em {
  font-size: 0.72rem;
  font-style: normal;
  color: #d8d8d8;
}

.fd-weight-preview-section {
  padding: 22px 24px 0;
}

.fd-weight-preview-title {
  font-size: 0.88rem;
  color: #f0f0f0;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.fd-weight-preview-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.fd-weight-preview-tools label {
  color: #cfcfcf;
  font-size: 0.76rem;
}

.fd-weight-preview-tools input {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid #343434;
  background: #141414;
  color: #f3f3f3;
  padding: 0 10px;
}

.fd-weight-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fd-weight-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #303030;
  background: #121212;
  border-radius: 10px;
  padding: 8px 10px;
}

.fd-weight-preview-label {
  color: #f2f2f2;
  font-size: 0.82rem;
  min-width: 78px;
}

.fd-weight-preview-sample {
  color: #ebebeb;
  font-size: 0.88rem;
  text-align: left;
}

.download-weight-btn {
  align-items: stretch;
  gap: 5px;
}

.download-weight-name {
  color: #ffffff;
  font-weight: 700;
}

.download-weight-sample {
  color: #e5e5e5;
  font-size: 0.84rem;
  text-align: right;
}

.download-weight-action {
  color: #bfbfbf;
}

/* ══════════════════════════ ADMIN CONTROLS PANEL ══════════════════════════ */
.admin-font-controls {
  border: 1px solid #313131;
  background: #101010;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-font-controls-head h4 {
  margin-bottom: 10px;
  color: #f2f2f2;
  font-size: 0.96rem;
}

.admin-font-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-font-controls-grid-secondary {
  margin-top: 8px;
}

.admin-font-control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-font-control-item-wide {
  grid-column: span 2;
}

.admin-font-control-item label {
  color: #cbcbcb;
  font-size: 0.76rem;
}

.admin-font-controls-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.admin-inline-badges {
  display: inline-flex;
  gap: 6px;
  margin-inline-start: 8px;
  vertical-align: middle;
}

.admin-inline-badges .font-smart-badge {
  position: static;
  top: auto;
  right: auto;
  display: inline-flex;
  align-items: center;
}

.admin-font-meta-row {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #b7b7b7;
  font-size: 0.76rem;
}

.admin-weight-preview-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-weight-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #131313;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  padding: 5px 8px;
}

.admin-weight-preview-label {
  color: #f1f1f1;
  font-size: 0.76rem;
}

.admin-weight-preview-sample {
  color: #d6d6d6;
  font-size: 0.8rem;
  text-align: left;
}

/* ══════════════════════════ FINAL CONTRAST TUNE ══════════════════════════ */
html,
body {
  background: #070707 !important;
  color: #f5f5f5 !important;
}

.home-sub,
.home-lead,
.home-fonts-sub,
.font-card-en,
.src-url,
.fd-desc,
.fd-desc-en,
.fd-license-row,
.stat-label,
.stats-kpi-label,
.stats-recent-font,
.download-weights-subtitle,
.links-empty,
.empty-msg {
  color: #c6c6c6 !important;
}

.drawer-item,
.search-icon,
.search-clear,
.atab,
.admin-item-info p {
  color: #d4d4d4 !important;
}

.drawer-item.active,
.atab.active,
.font-card-ar,
.src-title,
.stats-font-name,
.fd-title-ar,
.home-title,
.home-fonts-title,
.sec-title {
  color: #ffffff !important;
}

.home-search-box,
.search-suggestions,
.social-row-card,
.font-card,
.admin-item,
.stats-font-row,
.stats-kpi-item,
.stats-recent-wrap,
.modal-card,
.add-form,
.stat-card {
  background: #0f0f0f !important;
  border-color: #2c2c2c !important;
}

.weight-tag,
.fd-weight-tag,
.fd-wcat-tag,
.stats-font-count {
  background: #171717 !important;
  border-color: #343434 !important;
  color: #e8e8e8 !important;
}

.btn-white {
  background: #f2f2f2 !important;
  color: #111111 !important;
}

.btn-white:hover {
  background: #ffffff !important;
}

@media (max-width: 980px) {
  .admin-font-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-font-control-item-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .admin-font-controls-grid {
    grid-template-columns: 1fr;
  }

  .admin-font-control-item-wide {
    grid-column: auto;
  }

  .fd-weight-preview-section {
    padding: 16px 12px 0;
  }
}

/* ══════════════════════════ CARD SIZE HOTFIX ══════════════════════════ */
.fonts-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px)) !important;
  justify-content: center !important;
  gap: 14px !important;
}

.font-card {
  width: 100% !important;
  max-width: 340px !important;
  margin: 0 auto !important;
  min-height: 0 !important;
}

.font-card-media {
  aspect-ratio: 16 / 11 !important;
  max-height: none !important;
}

.font-card-body {
  bottom: 30px !important;
  padding: 10px 11px 6px !important;
}

.font-card-preview {
  gap: 3px !important;
}

.font-card-ar {
  font-size: clamp(1.06rem, 2.1vw, 1.45rem) !important;
}

.font-card-en {
  font-size: 0.8rem !important;
}

.font-card-footer {
  padding: 6px 10px !important;
}

.font-card-weight-count {
  font-size: 0.68rem;
  color: #e9e9e9;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.font-card-weights,
.font-card-weight-previews {
  display: none !important;
}

@media (max-width: 640px) {
  .fonts-grid {
    grid-template-columns: 1fr !important;
  }

  .font-card {
    max-width: 94vw !important;
  }

  .font-card-media {
    aspect-ratio: 4 / 3 !important;
    max-height: none !important;
  }
}

/* ══════════════════════════ SLIDER RELOCATION ══════════════════════════ */
body[data-page='home'] #home-slider-wrap,
body[data-page='fonts'] #home-slider-wrap,
body[data-page='accounts'] #home-slider-wrap,
body[data-page='admin'] #home-slider-wrap {
  display: none !important;
}

body[data-page='font'] #fd-slider-anchor {
  margin-top: 8px;
}

body[data-page='font'] #fd-slider-anchor .home-slider-wrap {
  margin: 0 0 12px !important;
  width: 100% !important;
}

body[data-page='font'] #fd-slider-anchor .home-slider {
  height: clamp(190px, 34vw, 360px) !important;
}

@media (max-width: 640px) {
  body[data-page='font'] #fd-slider-anchor .home-slider {
    height: clamp(176px, 55vw, 260px) !important;
  }
}

/* ══════════════════════════ PROFESSIONAL FILTER UI ══════════════════════════ */
.home-search-wrap,
#font-advanced-filters,
.search-suggestions {
  display: none !important;
}

.home-fonts-head {
  align-items: center !important;
}

.home-fonts-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.home-filter-wrap {
  position: relative;
}

.home-tool-btn {
  height: 36px;
  border: 1px solid #343434;
  background: #121212;
  color: #f1f1f1;
  border-radius: 10px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.home-tool-btn:hover {
  background: #1b1b1b;
  border-color: #4b4b4b;
}

.home-tool-btn i {
  font-size: 0.78rem;
}

.home-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, 84vw);
  background: #101010;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  z-index: 45;
  padding: 10px;
}

.home-filter-popover-head {
  margin-bottom: 7px;
  font-size: 0.82rem;
  color: #f3f3f3;
}

.home-filter-popover-grid {
  display: grid;
  gap: 7px;
}

.home-filter-popover .font-filter-item {
  gap: 3px;
}

.home-filter-popover .font-filter-item label {
  color: #cfcfcf;
  font-size: 0.72rem;
}

.home-filter-popover .font-filter-item select {
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.76rem;
  padding: 0 8px;
  background: #141414;
  border: 1px solid #313131;
  color: #eeeeee;
}

.home-filter-popover-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.home-filter-reset {
  border: 1px solid #343434;
  background: #151515;
  color: #d8d8d8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.home-filter-reset:hover {
  background: #1c1c1c;
  color: #ffffff;
}

@media (max-width: 700px) {
  .home-fonts-head {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px;
  }

  .home-fonts-actions {
    gap: 6px;
  }

  .home-tool-btn {
    height: 34px;
    padding: 0 9px;
  }

  .home-tool-btn span {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ══════════════════════════ ADMIN STANDALONE PAGE ══════════════════════════ */
body[data-page='admin'] #topbar,
body[data-page='admin'] #drawer,
body[data-page='admin'] #drawer-overlay,
body[data-page='admin'] #app {
  display: none !important;
}

body[data-page='admin'] #admin-panel {
  position: relative;
  inset: auto;
  min-height: 100dvh;
  padding-bottom: 56px;
  background:
    radial-gradient(1000px 420px at 90% -120px, rgba(197, 106, 68, 0.14), transparent 60%),
    radial-gradient(760px 320px at -10% 0%, rgba(31, 122, 114, 0.1), transparent 58%),
    #070707;
}

body[data-page='admin'] .admin-topbar {
  background: rgba(16, 16, 16, 0.9);
  backdrop-filter: blur(10px);
  border-bottom-color: #2d2d2d;
}

body[data-page='admin'] .atab-content {
  max-width: 980px;
}

body[data-page='admin'] .admin-font-controls {
  border-color: #3a3a3a;
  background: #0f0f0f;
}

body[data-page='admin'] .admin-font-controls-grid {
  gap: 10px;
}

body[data-page='admin'] .admin-font-control-item-wide {
  grid-column: span 3;
}

body[data-page='admin'] #admin-font-search {
  min-height: 40px;
  border-radius: 10px;
  border-color: #3f3f3f;
  background: #131313;
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  body[data-page='admin'] .admin-font-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page='admin'] .admin-font-control-item-wide {
    grid-column: span 2;
  }
}

/* ══════════════════════════ FINAL HOME/FONTS FIXES ══════════════════════════ */
body[data-page='home'] #sec-home,
body[data-page='fonts'] #sec-home {
  min-height: auto !important;
  padding-top: 0 !important;
}

body[data-page='home'] .home-hero {
  padding: 8px 10px 10px !important;
  gap: 6px !important;
}

body[data-page='fonts'] .home-hero {
  display: none !important;
}

body[data-page='home'] .home-logo-wrap {
  width: 160px !important;
  height: 160px !important;
}

body[data-page='home'] .home-ring {
  inset: -8px !important;
  transform-origin: 50% 50%;
  animation: spin 12s linear infinite;
}

body[data-page='home'] .home-ring::after {
  top: 50% !important;
  left: 100% !important;
  transform: translate(-50%, -50%) !important;
  width: 8px;
  height: 8px;
}

body[data-page='home'] .home-fonts-section,
body[data-page='fonts'] .home-fonts-section {
  padding-top: 6px !important;
}

body[data-page='home'] .home-fonts-head,
body[data-page='fonts'] .home-fonts-head {
  padding: 0 10px 6px !important;
  margin: 0 !important;
  gap: 8px;
}

body[data-page='home'] .home-search-wrap,
body[data-page='fonts'] .home-search-wrap,
body[data-page='home'] .home-search-wrap.hidden,
body[data-page='fonts'] .home-search-wrap.hidden {
  display: block !important;
  width: min(980px, calc(100% - 20px));
  margin: 0 auto 8px !important;
}

body[data-page='home'] .search-suggestions,
body[data-page='fonts'] .search-suggestions {
  display: block !important;
}

body[data-page='home'] .search-suggestions.hidden,
body[data-page='fonts'] .search-suggestions.hidden {
  display: none !important;
}

body[data-page='home'] .fonts-grid,
body[data-page='fonts'] .fonts-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 12px !important;
  padding: 8px 10px 20px !important;
}

body[data-page='home'] .font-card,
body[data-page='fonts'] .font-card {
  max-width: none !important;
  width: 100% !important;
}

body[data-page='home'] .font-card-media,
body[data-page='fonts'] .font-card-media {
  aspect-ratio: 16 / 10 !important;
  max-height: none !important;
}

@media (max-width: 720px) {
  body[data-page='home'] .fonts-grid,
  body[data-page='fonts'] .fonts-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page='home'] .font-card,
  body[data-page='fonts'] .font-card {
    max-width: 100% !important;
  }
}

/* ══════════════════════════ ULTRA COMPACT POLISH ══════════════════════════ */
main#content {
  min-height: auto !important;
}

body[data-page='home'] .home-title {
  font-size: clamp(2rem, 5.8vw, 2.55rem) !important;
  line-height: 1.04 !important;
  margin-bottom: 0 !important;
}

body[data-page='home'] .home-sub {
  margin-top: 0 !important;
  font-size: 0.8rem !important;
}

body[data-page='home'] .home-lead {
  margin-top: 0 !important;
  max-width: 620px !important;
  line-height: 1.45 !important;
  font-size: 0.88rem !important;
}

body[data-page='home'] .home-fonts-title,
body[data-page='fonts'] .home-fonts-title {
  font-size: clamp(1.14rem, 2vw, 1.45rem) !important;
  margin: 0 !important;
}

body[data-page='home'] .home-fonts-sub,
body[data-page='fonts'] .home-fonts-sub {
  margin-top: 1px !important;
  font-size: 0.8rem !important;
  line-height: 1.35 !important;
}

body[data-page='home'] .font-card-body,
body[data-page='fonts'] .font-card-body {
  bottom: 26px !important;
  padding: 8px 9px 5px !important;
}

body[data-page='home'] .font-card-footer,
body[data-page='fonts'] .font-card-footer {
  padding: 5px 9px !important;
}

body[data-page='home'] .font-card-ar,
body[data-page='fonts'] .font-card-ar {
  font-size: clamp(1rem, 2vw, 1.35rem) !important;
}

body[data-page='home'] .font-card-en,
body[data-page='fonts'] .font-card-en {
  font-size: 0.76rem !important;
}

body[data-page='font'] .font-detail-page {
  padding-top: 0 !important;
  padding-bottom: 14px !important;
}

body[data-page='font'] .font-detail-back {
  margin-bottom: 4px !important;
  padding: 7px 10px !important;
}

body[data-page='font'] .font-detail-header {
  padding: 2px 10px 8px !important;
}

body[data-page='font'] .fd-title-ar {
  line-height: 1.05 !important;
  margin-bottom: 1px !important;
}

body[data-page='font'] .fd-title-en {
  margin-top: 0 !important;
  margin-bottom: 2px !important;
}

body[data-page='font'] .fd-images {
  margin-top: 6px !important;
  padding: 0 6px !important;
}

body[data-page='font'] .fd-weights-section,
body[data-page='font'] .fd-pricing-section,
body[data-page='font'] .fd-weight-preview-section {
  padding-top: 10px !important;
  margin-top: 0 !important;
}

/* ══════════════════════════ FONT CARD CLEAN LAYOUT ══════════════════════════ */
body[data-page='home'] .fonts-grid,
body[data-page='fonts'] .fonts-grid {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)) !important;
  gap: 14px !important;
}

body[data-page='home'] .font-card,
body[data-page='fonts'] .font-card {
  display: flex !important;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
}

body[data-page='home'] .font-card-media,
body[data-page='fonts'] .font-card-media {
  aspect-ratio: 16 / 10 !important;
  padding: 0 !important;
}

body[data-page='home'] .font-card-body,
body[data-page='fonts'] .font-card-body {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  background: #101010 !important;
  padding: 10px 12px 6px !important;
}

body[data-page='home'] .font-card-preview,
body[data-page='fonts'] .font-card-preview {
  gap: 3px !important;
}

body[data-page='home'] .font-card-ar,
body[data-page='fonts'] .font-card-ar {
  font-size: clamp(1.08rem, 2.2vw, 1.5rem) !important;
  line-height: 1.18 !important;
  text-shadow: none !important;
}

body[data-page='home'] .font-card-en,
body[data-page='fonts'] .font-card-en {
  font-size: 0.8rem !important;
  color: #c7c7c7 !important;
}

body[data-page='home'] .font-card-footer,
body[data-page='fonts'] .font-card-footer {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  background: #0d0d0d !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 8px 12px !important;
}

body[data-page='home'] .font-card-arrow,
body[data-page='fonts'] .font-card-arrow {
  opacity: 1 !important;
  transform: none !important;
  color: #d6d6d6 !important;
}

body[data-page='home'] .font-card-weight-count,
body[data-page='fonts'] .font-card-weight-count {
  font-size: 0.74rem;
}

@media (max-width: 720px) {
  body[data-page='home'] .fonts-grid,
  body[data-page='fonts'] .fonts-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════ FINAL SLIDER + FOOTER FIXES ══════════════════════════ */
body[data-page='font'] .home-slider-wrap {
  width: min(1180px, calc(100% - 14px));
  margin: 10px auto 0 !important;
  border-radius: 16px !important;
  overflow: hidden;
}

body[data-page='font'] .home-slider {
  padding-top: 0 !important;
  height: clamp(260px, 68vh, 820px);
}

body[data-page='font'] .home-slide img {
  object-fit: cover !important;
  object-position: center center !important;
  background: #0d0d0d;
}

body[data-page='font'] .slider-arrow-prev {
  right: 16px !important;
}

body[data-page='font'] .slider-arrow-next {
  left: 16px !important;
}

body.lang-ltr[data-page='font'] .slider-arrow-prev {
  left: 16px !important;
  right: auto !important;
}

body.lang-ltr[data-page='font'] .slider-arrow-next {
  right: 16px !important;
  left: auto !important;
}

.site-footer {
  margin-top: 18px;
  padding: 14px 12px 22px;
  border-top: 1px solid var(--border2);
  text-align: center;
  color: var(--muted2);
  font-size: 0.8rem;
  font-family: var(--font-latin);
  background: rgba(255, 255, 255, 0.32);
}

:root[data-theme='dark'] .site-footer {
  background: rgba(20, 26, 36, 0.5);
  border-top-color: var(--border2);
  color: #a5b3ce;
}

@media (max-width: 720px) {
  body[data-page='font'] .home-slider {
    height: clamp(210px, 56vh, 560px);
  }

  .site-footer {
    font-size: 0.75rem;
    padding-bottom: 18px;
  }
}

/* ══════════════════════════ SOCIAL ICON-ONLY MODE ══════════════════════════ */
.social-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(64px, 76px));
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
}

.social-icon-card {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--border2);
  background: rgba(255, 251, 243, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f2217;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(64, 46, 29, 0.12);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
}

.social-icon-card .src-icon {
  font-size: 1.55rem;
  color: inherit;
}

.social-icon-card .src-icon svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.social-icon-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 114, 0.48);
  background: #fff5e8;
  box-shadow: 0 14px 28px rgba(42, 74, 71, 0.2);
  color: #174f4a;
}

.social-icon-card:active {
  transform: scale(0.97);
}

.social-icon-card:focus-visible {
  outline: 3px solid rgba(31, 122, 114, 0.45);
  outline-offset: 2px;
}

:root[data-theme='dark'] .social-icon-card {
  background: rgba(23, 29, 39, 0.95);
  border-color: rgba(67, 192, 178, 0.26);
  color: #d8e9ff;
  box-shadow: 0 12px 24px rgba(5, 8, 14, 0.34);
}

:root[data-theme='dark'] .social-icon-card:hover {
  background: rgba(30, 39, 52, 0.98);
  border-color: rgba(67, 192, 178, 0.52);
  color: #9fe6dd;
}

@media (max-width: 520px) {
  .social-grid {
    grid-template-columns: repeat(auto-fit, minmax(58px, 68px));
    gap: 8px;
  }

  .social-icon-card {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
}

/* ══════════════════════════ FINAL PUBLIC UI STABILITY FIXES ══════════════════════════ */
#topbar {
  position: sticky !important;
  top: 0 !important;
}

#app,
main#content,
#sec-home,
#sec-fonts,
#sec-accounts,
#sec-font-detail {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.sec-inner,
.font-detail-page {
  padding-top: 10px !important;
}

body.lang-rtl .home-sub,
body.lang-rtl .home-lead,
body.lang-rtl .fd-desc,
body.lang-rtl .fd-desc-ar,
body.lang-rtl .font-card-en {
  direction: rtl !important;
  unicode-bidi: isolate !important;
  text-align: right !important;
}

body:not(.lang-rtl) .home-sub,
body:not(.lang-rtl) .home-lead,
body:not(.lang-rtl) .fd-desc,
body:not(.lang-rtl) .fd-desc-ar,
body:not(.lang-rtl) .font-card-en {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  text-align: left !important;
}

/* Keep Arabic labels RTL even inside LTR UI (Safari/iOS safe). */
.font-card-ar,
.fd-title-ar {
  direction: rtl !important;
  unicode-bidi: isolate !important;
  text-align: right !important;
}

body.lang-rtl .home-title,
body.lang-rtl .drawer-title {
  direction: rtl !important;
  unicode-bidi: isolate !important;
}

body.lang-ltr .home-title,
body.lang-ltr .drawer-title {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

#slider-counter,
#image-viewer-caption {
  direction: ltr !important;
  unicode-bidi: isolate;
  text-align: center !important;
}

#fd-images {
  display: block !important;
  margin-top: 14px !important;
  padding: 0 12px !important;
}

#fd-images .fd-gallery {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 14px !important;
}

#fd-images .fd-shot,
#fd-images .fd-shot-hero,
#fd-images .fd-shot-wide,
#fd-images .fd-shot-tall {
  grid-column: auto !important;
  aspect-ratio: auto !important;
  min-height: 220px !important;
  max-height: none !important;
  border: 1px solid #2c2c2c !important;
  border-radius: 14px;
  background: #090909 !important;
  padding: 10px !important;
}

#fd-images .fd-shot img,
#fd-images .fd-shot-hero img,
#fd-images .fd-shot-wide img,
#fd-images .fd-shot-tall img {
  width: 100% !important;
  height: auto !important;
  max-height: 78vh !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.image-viewer-stage {
  width: min(96vw, 1200px) !important;
  max-height: 86vh !important;
}

.image-viewer-stage img {
  width: 100% !important;
  height: 100% !important;
  max-height: 84vh !important;
  object-fit: cover !important;
  object-position: center center !important;
}

@media (min-width: 960px) {
  #fd-images .fd-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .home-title,
  .fd-title-ar {
    line-height: 1.12 !important;
  }

  .home-lead,
  .fd-desc {
    line-height: 1.7 !important;
  }

  .font-card {
    overflow: visible !important;
  }

  .font-card-body {
    position: static !important;
    background: transparent !important;
    padding: 12px 12px 6px !important;
  }

  .font-card-footer {
    position: static !important;
    background: transparent !important;
    border-top: none !important;
    padding: 0 12px 12px !important;
  }

  .font-card-media {
    aspect-ratio: 16 / 10 !important;
  }
}

/* --- Fixes for Slider Height --- */
.home-slider, body[data-page='font'] #fd-slider-anchor .home-slider {
  height: auto !important;
  min-height: 200px;
}
.home-slide.active {
  position: relative;
  display: block;  opacity: 1; pointer-events: auto; transform: translateX(0); z-index: 2;
}
.home-slide img {
  width: 100%;
  height: auto !important;
  object-fit: cover !important;
  display: block;
}
.fd-gallery {
  display: none !important;
}

/* Fix top spacing */
.home-hero { padding-top: 10px !important; margin-top: 20px !important; }
.home-logo-wrap { margin-bottom: 30px !important; }

/* Fix overlaps with topbar */
#topbar { z-index: 9999 !important; }
.home-slider-wrap { z-index: 10 !important; }
.home-filters-wrap { z-index: 10 !important; }

/* Increase preview text box size */
.fd-preview-stage { min-height: 350px !important; }
.fd-preview-input { font-size: 32px !important; min-height: 250px !important; }

/* V2 Fixes */
#slider-prev, .slider-arrow-prev, body[data-page='font'] .slider-arrow-prev { left: 20px !important; right: auto !important; }
#slider-next, .slider-arrow-next, body[data-page='font'] .slider-arrow-next { right: 20px !important; left: auto !important; }

.home-slider, body[data-page='font'] #fd-slider-anchor .home-slider { height: clamp(200px, 45vw, 600px) !important; padding-top: 0 !important; }
.home-slide img { object-fit: cover !important; height: 100% !important; width: 100%; display: block; }
.home-slide-label { display: none !important; }
#fd-images, .fd-gallery { display: none !important; }
.home-hero, body[data-page='home'] .home-hero { padding-top: 10px !important; margin-top: 0 !important; gap: 6px !important; }
body[data-page='font'] #app { padding-top: 0 !important; }
main#content { padding-top: 0 !important; }
#app { padding-top: 0 !important; }
#topbar { position: relative !important; top: 0 !important; z-index: 900 !important; }

/* V3 Fixes - Accounts styling & Footer */
/* Accounts Page Improvements */
.social-grid, #social-grid, #work-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 20px;
}
.social-icon-card {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-family: var(--font-med);
  font-weight: 600;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.social-icon-card:hover {
  transform: translateY(-2px);
  background: var(--bg3);
  border-color: rgba(255,255,255,0.2) !important;
}
.social-icon-card .src-icon, .social-icon-card i {
  font-size: 1.4rem;
}

/* Footer layout */
.site-footer {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-social-links {
  display: flex;
  gap: 14px;
}
.footer-social-links a {
  color: var(--muted2);
  font-size: 1.2rem;
  transition: color 0.2s, transform 0.2s;
}
.footer-social-links a:hover {
  color: var(--text);
  transform: translateY(-2px);
}
.footer-copyright {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Visitor Counter */
.visitor-counter-wrap {
  margin-top: 20px;
  font-size: 1.1rem;
  color: var(--muted2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg2);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  width: fit-content;
  margin-inline: auto;
}
.home-slide img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
}

/* V3 Accounts Grid Update */
.social-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-top: 2rem !important;
    padding: 0 1rem;
}
.social-icon-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.social-icon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
    background: #fdfdfd;
}
.social-icon-card .social-icon {
    font-size: 2.2rem !important;
    margin-bottom: 0.8rem !important;
    color: #444;
}
.social-icon-card .social-text span {
    font-size: 1.1rem;
    font-weight: 500;
}
.src-title.hidden {
    display: none !important;
}

/* Beautiful Social Grid */
.social-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 1rem !important;
}
.social-icon-card {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: 12px !important;
    padding: 2rem 1rem !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.1, 0.7, 0.1, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02) !important;
    text-decoration: none !important;
    color: #111 !important;
}
.social-icon-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.1) !important;
}
.card-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
}
.card-inner .src-icon {
    font-size: 2.8rem !important;
    line-height: 1 !important;
    color: #333 !important;
}
.card-inner .src-label {
    font-size: 1.1rem !important;
    font-family: var(--font-bold) !important;
    font-weight: 700 !important;
}

/* Footer Flex */
.site-footer {
    width: 100% !important;
    background: transparent !important;
    padding: 2rem 5% !important;
}
.footer-content {
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 1.5rem !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}
html[dir='rtl'] .footer-content {
    flex-direction: row !important;
}
html[dir='ltr'] .footer-content {
    flex-direction: row-reverse !important;
}
.footer-copyright {
    font-size: 0.95rem !important;
    color: #666 !important;
    font-family: var(--font-reg) !important;
}
.footer-socials {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
}
.footer-social-icon {
    font-size: 1.4rem !important;
    color: #444 !important;
    transition: color 0.2s, transform 0.2s !important;
    text-decoration: none !important;
}
.footer-social-icon:hover {
    color: #000 !important;
    transform: translateY(-2px) !important;
}#topbar { z-index: 99999 !important; }
#drawer-overlay { z-index: 9990 !important; }
#drawer { z-index: 9995 !important; }

/* V7 REBUILT GALLERY + LINK ICONS */
body[data-page='font'] #fd-images {
  display: block !important;
  margin-top: 24px !important;
  padding: 0 12px !important;
}

body[data-page='font'] #fd-images .fd-media-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-page='font'] #fd-images .fd-media-stage-wrap {
  position: relative;
  border-radius: 16px;
  overflow: visible;
  border: 1px solid rgba(255,255,255,0.14);
  background: #0c0c0c;
  box-shadow: 0 18px 36px rgba(0,0,0,0.35);
}

body[data-page='font'] #fd-images .fd-media-stage-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

body[data-page='font'] #fd-images .fd-media-stage-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

body[data-page='font'] #fd-images .fd-media-stage-img.fd-media-stage-fade {
  animation: fdMediaStageFade 0.34s ease both;
}

@keyframes fdMediaStageFade {
  from {
    opacity: 0.34;
    transform: scale(1.012);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

body[data-page='font'] #fd-images .fd-media-stage-open:hover .fd-media-stage-img {
  transform: scale(1.015);
}

body[data-page='font'] #fd-images .fd-media-stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.68), rgba(0,0,0,0.05) 48%, transparent 72%);
}

body[data-page='font'] #fd-images .fd-media-stage-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

body[data-page='font'] #fd-images .fd-media-stage-title {
  color: #fff;
  font-size: 0.92rem;
  font-family: var(--font-black);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page='font'] #fd-images .fd-media-stage-counter {
  color: rgba(255,255,255,0.94);
  font-size: 0.76rem;
  font-family: var(--font-latin);
  background: rgba(8,8,8,0.72);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 4px 10px;
  flex-shrink: 0;
}

body[data-page='font'] #fd-images .fd-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body[data-page='font'] #fd-images .fd-media-nav:hover {
  background: rgba(0,0,0,0.72);
}

body[data-page='font'] #fd-images .fd-media-nav.prev {
  right: -18px;
}

body[data-page='font'] #fd-images .fd-media-nav.next {
  left: -18px;
}

body[data-page='font'] #fd-images .fd-media-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 4px 4px;
}

body[data-page='font'] #fd-images .fd-media-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  font-size: 0.62rem;
  font-family: var(--font-latin);
}

body[data-page='font'] #fd-images .fd-media-dot:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.18);
}

body[data-page='font'] #fd-images .fd-media-dot.active {
  background: #ffffff;
  color: #111;
  border-color: #ffffff;
}

body[data-page='font'] #fd-images .fd-media-dot span {
  line-height: 1;
}

.social-icon-card .card-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.social-icon-card .src-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.social-icon-card .src-label {
  display: block !important;
}

@media (max-width: 640px) {
  body[data-page='font'] #fd-images .fd-media-dot {
    width: 22px;
    height: 22px;
    font-size: 0.58rem;
  }

  body[data-page='font'] #fd-images .fd-media-nav {
    width: 34px;
    height: 34px;
  }

  body[data-page='font'] #fd-images .fd-media-nav.prev {
    right: -10px;
  }

  body[data-page='font'] #fd-images .fd-media-nav.next {
    left: -10px;
  }
}

/* V8 PAGE TRANSITIONS */
body.page-transition-ready {
  transition: opacity 0.26s ease, filter 0.26s ease;
}

body.page-transition-enter {
  opacity: 0;
  filter: blur(2px);
}

body.page-transition-leave {
  opacity: 0;
  filter: blur(2px);
  pointer-events: none;
}

/* V9 GEEZA TYPOGRAPHY + LOGO STABILITY */
body[data-page='font'] .font-detail-page {
  font-family: var(--font-med);
}

body[data-page='font'] .font-detail-page .fd-download-btn,
body[data-page='font'] .font-detail-page .fd-download-btn span,
body[data-page='font'] .font-detail-page .font-detail-back,
body[data-page='font'] .font-detail-page .fd-weights-text,
body[data-page='font'] .font-detail-page .fd-usage-pill,
body[data-page='font'] .font-detail-page .fd-price-large,
body[data-page='font'] .font-detail-page .fd-license-row,
body[data-page='font'] .font-detail-page .fd-wcat,
body[data-page='font'] .font-detail-page .fd-media-stage-meta,
body[data-page='font'] .font-detail-page .fd-media-dot {
  font-family: var(--font-med) !important;
}

#topbar-logo,
.home-logo,
#splash-logo {
  visibility: visible !important;
  opacity: 1 !important;
}

#topbar-logo.logo-fallback,
.home-logo.logo-fallback,
#splash-logo.logo-fallback {
  filter: none !important;
}

/* V10 ACCOUNTS RAILS + ICON VISIBILITY */
body[data-page='font'] .font-detail-page .fd-download-btn i,
#home-download-all-zip i,
#download-all-weights-zip-btn i,
.visitor-counter-wrap i {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
  font-style: normal;
  font-weight: 900;
  display: inline-block;
}

#topbar {
  gap: 10px !important;
}

#topbar-accounts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  margin-inline-end: 8px;
}

#topbar-accounts.hidden {
  display: none !important;
}

.topbar-account-link {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.topbar-account-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.16);
}

.google-favicon-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

.social-icon-card .google-favicon-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-footer {
  padding: 14px 12px 20px !important;
}

.site-footer-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer-copy {
  color: inherit;
  font-size: 0.82rem;
}

.site-footer-accounts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer-accounts.hidden {
  display: none !important;
}

.footer-account-link {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(86, 76, 62, 0.22);
  background: rgba(255, 255, 255, 0.46);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.footer-account-link:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 122, 114, 0.45);
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 760px) {
  #topbar-accounts {
    gap: 6px;
    margin-inline-end: 4px;
  }

  .topbar-account-link {
    width: 28px;
    height: 28px;
  }

  #topbar-accounts .topbar-account-link:nth-child(n + 5) {
    display: none;
  }

  .site-footer-content {
    justify-content: center;
    text-align: center;
  }
}

/* FINAL FONT LIBRARY VISIBILITY GUARD */
body[data-page='home'] #sec-home,
body[data-page='fonts'] #sec-home {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body[data-page='home'] #home-fonts-section,
body[data-page='fonts'] #home-fonts-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body[data-page='home'] #home-fonts-grid,
body[data-page='fonts'] #home-fonts-grid {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body[data-page='home'] #home-fonts-grid .font-card,
body[data-page='fonts'] #home-fonts-grid .font-card {
  display: flex !important;
}

/* FINAL DIRECTIONAL ARROW FIX */
body.lang-rtl #slider-prev,
body.lang-rtl .slider-arrow-prev,
body.lang-rtl[data-page='font'] .slider-arrow-prev {
  right: 20px !important;
  left: auto !important;
}

body.lang-rtl #slider-next,
body.lang-rtl .slider-arrow-next,
body.lang-rtl[data-page='font'] .slider-arrow-next {
  left: 20px !important;
  right: auto !important;
}

body.lang-ltr #slider-prev,
body.lang-ltr .slider-arrow-prev,
body.lang-ltr[data-page='font'] .slider-arrow-prev {
  left: 20px !important;
  right: auto !important;
}

body.lang-ltr #slider-next,
body.lang-ltr .slider-arrow-next,
body.lang-ltr[data-page='font'] .slider-arrow-next {
  right: 20px !important;
  left: auto !important;
}

body.lang-rtl[data-page='font'] #fd-images .fd-media-nav.prev {
  right: -18px !important;
  left: auto !important;
}

body.lang-rtl[data-page='font'] #fd-images .fd-media-nav.next {
  left: -18px !important;
  right: auto !important;
}

body.lang-ltr[data-page='font'] #fd-images .fd-media-nav.prev {
  left: -18px !important;
  right: auto !important;
}

body.lang-ltr[data-page='font'] #fd-images .fd-media-nav.next {
  right: -18px !important;
  left: auto !important;
}

@media (max-width: 640px) {
  body.lang-rtl[data-page='font'] #fd-images .fd-media-nav.prev {
    right: -10px !important;
    left: auto !important;
  }

  body.lang-rtl[data-page='font'] #fd-images .fd-media-nav.next {
    left: -10px !important;
    right: auto !important;
  }

  body.lang-ltr[data-page='font'] #fd-images .fd-media-nav.prev {
    left: -10px !important;
    right: auto !important;
  }

  body.lang-ltr[data-page='font'] #fd-images .fd-media-nav.next {
    right: -10px !important;
    left: auto !important;
  }
}

