/* ---------- IBM Plex Sans Arabic — مستضاف ذاتياً ----------
   كان الخط يُحمَّل من Google Fonts، فيسقط إلى الخط الافتراضي للنظام كلما تعذّر
   الوصول إلى fonts.gstatic.com — وservice worker لا يستطيع تخزينه مؤقتاً لأن
   الاستجابة عابرة النطاق تعود opaque (res.ok=false)، أي أنه كان يُحمَّل من
   جوجل في كل مرة. الملفات الآن داخل الموقع نفسه، فلا يسقط الخط أبداً. */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-600-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-arabic-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Single-family system per the site's font spec (all weights of IBM Plex Sans Arabic,
     see .ibm-plex-sans-arabic-* utility classes) — no secondary display face. */
  --font-display: "IBM Plex Sans Arabic", sans-serif;

  --color-bg: #ffffff;
  --color-bg-soft: #f4faf9;
  --color-bg-card: #ffffff;
  --color-text: #1e2a28;
  --color-text-muted: #5b6b68;
  --color-border: #dbe7e5;

  --color-accent: #0f5c56;
  --color-accent-dark: #0b443f;
  --color-accent-light: #dcefed;

  --color-danger: #b3261e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --container-width: 1120px;

  /* Premium elevation scale — ambient + directional shadow layered together (a single flat
     box-shadow reads flat/cheap; two shadows of different spread/blur read as real depth),
     tinted with the accent hue at low alpha instead of pure black so shadows feel warm and
     native to the palette rather than a generic dark smudge. */
  --shadow-color: 168, 62%, 21%;
  --shadow-xs: 0 1px 2px hsla(var(--shadow-color), 0.06);
  --shadow-sm: 0 1px 2px hsla(var(--shadow-color), 0.05), 0 4px 10px hsla(var(--shadow-color), 0.06);
  --shadow-md: 0 2px 4px hsla(var(--shadow-color), 0.05), 0 12px 24px -4px hsla(var(--shadow-color), 0.1);
  --shadow-lg: 0 4px 8px hsla(var(--shadow-color), 0.04), 0 24px 48px -8px hsla(var(--shadow-color), 0.14);
  --shadow-focus: 0 0 0 4px hsla(var(--shadow-color), 0.14);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.18s;
  --duration-base: 0.28s;
  --duration-slow: 0.5s;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--color-accent);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* The `hidden` attribute maps to a UA-stylesheet rule `[hidden]{display:none}` with
   specificity 0-1-0 — the SAME specificity as any class selector (`.lightbox`, `.btn`,
   `.auth-form.grid-2` is 0-2-0 so it's even worse). An author-stylesheet class rule that
   sets `display` unconditionally silently wins over `[hidden]` regardless of source order,
   because author rules always outrank the UA stylesheet at equal/lower specificity — so an
   element marked `hidden` stayed visually displayed anyway (this is exactly what made the
   album/news lightbox show up on every page load, and would have hit any future `hidden`
   button/form/panel the same way). `!important` here is the standard fix for this specific
   attribute: it makes `hidden` always win, so components are free to set `display` however
   they like without needing to remember to guard it with `:not([hidden])` themselves. */
[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: -48px;
  right: 12px;
  z-index: 100;
  background: var(--color-accent);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1, h2 {
  font-family: var(--font-display);
}

h1 {
  font-weight: 700;
}

h2, h3, h4 {
  font-weight: 600;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 19px;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  transform: translateY(-1px);
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.overview-grid > .reveal:nth-child(2) {
  transition-delay: 0.1s;
}

.overview-grid > .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.badge-soon {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  background: #f0f0eb;
  color: var(--color-text-muted);
  margin-inline-start: 6px;
}

.link-disabled {
  color: var(--color-text-muted);
  cursor: default;
  pointer-events: none;
}

.placeholder-data-notice {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
}

.pending-approval-notice {
  background: #fdf3e3;
  color: #8a5a00;
  border: 1px dashed #d99a1f;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsla(0, 0%, 100%, 0.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
}

/* ---------- Personal greeting strip (js/session-ui.js) — logged-in members only, the
   first row inside <header> above the logo/nav so it's part of the header proper. ---------- */
.header-greeting-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 20px;
  background: var(--color-accent-light);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.header-greeting-text {
  color: var(--color-accent-dark);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-greeting-date {
  color: var(--color-text-muted);
  font-weight: 400;
  margin-inline-start: 10px;
}

@media (max-width: 640px) {
  .header-greeting-bar {
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px;
    font-size: 12.5px;
  }
  .header-greeting-date {
    margin-inline-start: 0;
    font-size: 11.5px;
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 20px;
}

.logo {
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 72px;
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  gap: 24px;
  flex: 1;
  justify-content: center;
  font-size: 16px;
}

.main-nav a {
  position: relative;
  font-weight: 500;
  padding-bottom: 4px;
  transition: color var(--duration-fast) var(--ease-out);
}

.main-nav a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--duration-base) var(--ease-out);
}

.main-nav a:hover {
  color: var(--color-accent-dark);
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.main-nav a.active {
  color: var(--color-accent-dark);
  font-weight: 700;
}

.main-nav a.active::after {
  transform: scaleX(1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}

.nav-dropdown-caret {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  inset-inline-start: 0;
  min-width: 160px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.nav-dropdown-menu a:hover {
  background: var(--color-bg-soft);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-close {
  display: none;
}

.nav-overlay {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-soft);
  padding: 156px 0 84px;
  text-align: center;
}

.hero + .content-section {
  padding-top: 40px;
}

.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 14% 18%, hsla(168, 62%, 21%, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, hsla(38, 70%, 55%, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 82% 82%, var(--color-accent-light) 0%, transparent 40%),
    radial-gradient(circle at 8% 88%, hsla(168, 62%, 21%, 0.08) 0%, transparent 34%);
}

.hero-decor::before,
.hero-decor::after {
  content: "";
  position: absolute;
  border: 1px solid var(--color-border);
  border-radius: 50%;
}

.hero-decor::before {
  width: 460px;
  height: 460px;
  top: -200px;
  inset-inline-end: -160px;
}

.hero-decor::after {
  width: 280px;
  height: 280px;
  bottom: -150px;
  inset-inline-start: -90px;
}

.hero .container {
  position: relative;
}

.hero-grid {
  display: block;
}

.hero-copy {
  text-align: center;
}

.hero .badge {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.hero h1 {
  font-size: 52px;
  line-height: 1.2;
  margin: 20px 0;
}

.hero-accent-word {
  color: var(--color-accent);
}

.hero-sub {
  max-width: 540px;
  font-size: 17px;
  margin: 0 auto 32px;
  color: var(--color-text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  padding: 14px 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-stat-number {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.hero-stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

@keyframes hero-reveal-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-reveal {
  opacity: 0;
  animation: hero-reveal-up 0.6s ease forwards;
  animation-delay: var(--d, 0s);
}

.hero-scroll-cue {
  position: relative;
  margin: 44px auto 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  animation: hero-scroll-bounce 1.8s ease-in-out infinite;
}

.hero-scroll-cue svg {
  width: 20px;
  height: 20px;
}

@keyframes hero-scroll-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-reveal {
    opacity: 1;
    animation: none;
  }

  .hero-scroll-cue {
    animation: none;
  }
}

.section-sub {
  color: var(--color-text-muted);
  font-size: 16px;
  margin-bottom: 40px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* A slightly wider lead card breaks the mechanical equal-thirds look in the three-card
   grids that use this class (council.html، achievements.html). */
@media (min-width: 900px) {
  .overview-grid {
    grid-template-columns: 1.15fr 1fr 1fr;
  }
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin: 4px 0 0;
}

.stat-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.stat-detail {
  color: var(--color-text-muted);
  font-size: 13px;
}

.event-list, .news-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.event-list li, .news-list li {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  font-size: 14px;
}

.event-day {
  color: var(--color-accent-dark);
  font-size: 12px;
}

.event-loc, .news-list span {
  color: var(--color-text-muted);
  font-size: 13px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-accent-dark);
  font-weight: 600;
  transition: gap var(--duration-fast) var(--ease-out);
}

.card-link:hover {
  gap: 8px;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  margin-top: 56px;
  padding: 40px 0 28px;
}

.footer-brand {
  text-align: start;
  margin-bottom: 20px;
}

.footer-brand .logo-img {
  height: 44px;
}

.footer-inner {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.footer-col h4 {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 32px;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  margin-inline-start: auto;
}

.footer-social h4 {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-social-icons {
  display: flex;
  gap: 10px;
}

.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.footer-social-icon:hover {
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.footer-social-icon svg {
  width: 16px;
  height: 16px;
}

.footer-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-top: 32px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 24px;
  }

  /* At the full 72px desktop height, the logo towers over the header's other icons
     (hamburger/avatar are ~36-40px) — .header-inner centers items on the cross axis, so the
     much-taller logo's top edge sits noticeably higher than its neighbors', reading as
     "raised" on narrow screens where that size mismatch is more visually obvious. */
  .header-inner {
    padding: 20px 20px 16px;
  }
  .logo-img {
    height: 48px;
  }

  /* Sticky + backdrop-filter turns the header into its own stacking context, which was
     putting the fixed mobile nav drawer/overlay in the wrong paint order and breaking the
     menu — keep the sticky treatment desktop-only and restore the plain static header here. */
  .site-header {
    position: static;
    background: var(--color-bg-soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
  }

  .hero {
    padding: 96px 0 48px;
  }

  .hero-sub {
    font-size: 15px;
  }

  /* شعار الفوتر وعمود "الأقسام" مخفيان على الجوال: الشعار يظهر أصلاً في الهيدر،
     وروابط الأقسام متاحة من درج التنقّل ومن شبكة "القائمة" في الرئيسية — فتكرارها
     هنا كان يطيل الفوتر بلا فائدة. يبقى "تابعونا" وسطر الحقوق. */
  .footer-brand,
  .footer-col {
    display: none;
  }

  /* على سطح المكتب يدفع هذا الهامش التلقائي "تابعونا" إلى أقصى الصف ليفصله عن عمود
     الروابط — وبعد إخفاء ذلك العمود هنا لم يعد له ما يفصله عنه، فصار يزحزح الأيقونات
     إلى الحافة المقابلة بدل تركها في بداية السطر. */
  .footer-social {
    margin-inline-start: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(78vw, 300px);
    background: var(--color-bg);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 20px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    visibility: hidden;
  }

  .main-nav.nav-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    margin-bottom: 12px;
  }

  .nav-close svg {
    width: 16px;
    height: 16px;
  }

  .main-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .main-nav a.active {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav a.active:last-child {
    border-bottom: none;
  }

  /* The green underline (::after) makes sense under a horizontal desktop nav link but reads
     as a stray bar under the full-width rows of the mobile drawer — the border-bottom divider
     above already marks the active item there. */
  .main-nav a::after {
    display: none;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-dropdown-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    margin-bottom: 0;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    display: flex;
  }

  .nav-dropdown-menu a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-dropdown-menu a:last-child {
    border-bottom: none;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 8, 0.4);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .hero h1 {
    font-size: 32px;
  }
}

.breadcrumb {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 16px 0 0;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.page-hero {
  background: var(--color-bg-soft);
  padding: 24px 0 40px;
}

.page-hero h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.content-section {
  padding: 72px 0;
}

.content-section.alt {
  background: var(--color-bg-soft);
}

.overview-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.plain-list {
  margin: 0;
  padding-inline-start: 18px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.plain-list li {
  margin-bottom: 6px;
}

.text-muted {
  color: var(--color-text-muted);
  font-size: 13px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-inline-start: 2px solid var(--color-border);
}

.timeline li {
  position: relative;
  padding: 0 24px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
}

.timeline-year {
  display: inline-block;
  font-size: 12px;
  color: var(--color-accent-dark);
  font-weight: 500;
  margin-bottom: 4px;
}

.timeline p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.leader-grid {
  grid-template-columns: repeat(4, 1fr);
}

.leader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.leader-card.current {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.leader-card.current .avatar-circle {
  background: #ffffff;
}

.leader-card.current strong {
  color: var(--color-accent-dark);
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ---------- الهيكل التنظيمي للمجلس: مخطط هرمي حقيقي (رئيس ← نائب/أمين سر/أمين صندوق ←
   اللجان) بدل شبكة مسطحة من 8 بطاقات متساوية. الحجم يتناقص كل مستوى ليعكس بصرياً مكان كل
   دور في التسلسل، والخطوط الرأسية تربط المستويات فعلياً. الضغط على أي دور (js/council.js)
   يبرز سلسلة القيادة الخاصة به صعوداً حتى الرئيس، ويُعتّم البقية — هذا هو الجزء "التفاعلي"
   الذي يوضّح من يتبع من دون اختلاق بيانات غير موجودة. ---------- */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
}

.org-chart-tier {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px 18px;
  width: 100%;
}

.org-chart-connector {
  position: relative;
  width: 2px;
  height: 36px;
  background: var(--color-border);
  transition: background-color var(--duration-base) var(--ease-out);
}

/* Small joint dots where the line meets each node — the detail that makes this read as a
   real org-chart connector rather than a stray vertical rule. */
.org-chart-connector::before,
.org-chart-connector::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  width: 6px;
  height: 6px;
  margin-inline-start: -3px;
  border-radius: 50%;
  background: inherit;
}

.org-chart-connector::before {
  top: -3px;
}

.org-chart-connector::after {
  bottom: -3px;
}

.org-chart-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  min-width: 172px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    opacity var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.org-chart-node:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.org-chart-node strong {
  font-size: 15px;
}

.org-chart-node .text-muted {
  margin-top: 4px;
  max-width: 160px;
  line-height: 1.6;
}

.org-chart-node-root {
  padding: 24px 36px;
  min-width: 200px;
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.org-chart-node-root strong {
  font-size: 18px;
  color: var(--color-accent-dark);
}

.org-chart-node-sm {
  min-width: 0;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}

.org-chart-node.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-light);
}

.org-chart-node.is-in-chain {
  border-color: var(--color-accent);
}

.org-chart.has-selection .org-chart-node:not(.is-active):not(.is-in-chain) {
  opacity: 0.4;
}

.org-chart-connector.is-active {
  background: var(--color-accent);
}

@media (max-width: 640px) {
  .org-chart-node {
    min-width: 0;
    width: 100%;
    max-width: 280px;
  }

  .org-chart-node-root {
    width: auto;
  }

  .org-chart-tier-2 .org-chart-node,
  .org-chart-tier-3 .org-chart-node {
    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  .overview-grid.three-col,
  .leader-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .overview-grid.three-col,
  .leader-grid {
    grid-template-columns: 1fr;
  }
}

.event-card h3 {
  margin: 8px 0 4px;
  font-size: 17px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.photo-placeholder {
  aspect-ratio: 1;
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.photo-placeholder svg {
  width: 28px;
  height: 28px;
}

.tree-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tree-search-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
}

.lock-notice {
  background: var(--color-bg-soft);
  margin-bottom: 24px;
}

.lock-notice p {
  margin: 4px 0 0;
}

.tree-wrapper {
  overflow-x: auto;
}

.tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-children:not(.root) {
  margin-inline-start: 24px;
  border-inline-start: 2px solid var(--color-border);
  padding-inline-start: 16px;
}

.tree-node.collapsed > .tree-children {
  display: none;
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tree-node-header:hover {
  background: var(--color-bg-soft);
}

.tree-toggle {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-toggle-icon {
  display: flex;
  transition: transform 0.2s ease;
}

.tree-toggle svg {
  width: 16px;
  height: 16px;
}

.tree-node.collapsed > .tree-node-header .tree-toggle-icon {
  transform: rotate(-90deg);
}

.avatar-circle.small {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.tree-node-info {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.tree-node-info .text-muted {
  font-size: 12px;
}

@media print {
  .no-print, .placeholder-data-notice {
    display: none !important;
  }
  .tree-node.collapsed > .tree-children {
    display: block !important;
  }
}

.login-link.active {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  cursor: pointer;
}

.user-menu-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.user-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 190px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -10px rgba(15, 92, 86, .25);
  padding: 8px;
  z-index: 200;
}

.user-menu-dropdown[hidden] {
  display: none;
}

.user-menu-name {
  padding: 8px 10px 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13.5px;
  text-align: start;
  cursor: pointer;
  text-decoration: none;
}

.user-menu-item:hover {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.user-menu-item.danger {
  color: var(--color-danger);
}

.user-menu-item.danger:hover {
  background: #fbe9e7;
  color: var(--color-danger);
}

.lock-notice strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lock-notice svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-section {
  padding: 88px 0;
}

.auth-container {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card.wide {
  max-width: 560px;
  padding: 32px;
}

@keyframes contact-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.contact-type-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-type-group legend {
  width: 100%;
  padding: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* شرائح نوع الرسالة بنفس طابع بطاقات "القائمة": خلفية فاتحة مشبعة لكل نوع، أيقونة
   ونص بدرجة داكنة من نفس اللون. عند الاختيار تُستبدل الخلفية بدرجة أعمق من العائلة
   نفسها (--t-deep) مع حلقة حولها — فالاختيار يظهر كتعمّق في اللون لا كتغيّر لونه. */
.contact-type-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--t-bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--t-ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-type-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.contact-type-chip svg {
  width: 17px;
  height: 17px;
  color: var(--t-icon);
  transition: color 0.2s ease;
}

.contact-type-chip:hover { background: var(--t-mid); }

.contact-type-chip:has(input:checked) {
  background: var(--t-deep);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--t-ring);
  transform: translateY(-1px);
}

.contact-type-chip:has(input:checked) svg { color: #ffffff; }

/* تركيز لوحة المفاتيح يظل ظاهراً: الحقل نفسه مخفي بصرياً، فلولا هذه القاعدة لما عرف
   من يتنقّل بالـ Tab أين هو. */
.contact-type-chip:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--t-ring), var(--shadow-focus);
}

.contact-type-chip[data-tone="indigo"] { --t-bg: #dbe4ff; --t-mid: #ccd9ff; --t-deep: #3b53c9; --t-ink: #2b3f96; --t-icon: #3b53c9; --t-ring: rgba(59, 83, 201, 0.22); }
.contact-type-chip[data-tone="rose"]   { --t-bg: #ffdede; --t-mid: #ffcfcf; --t-deep: #b93a3a; --t-ink: #a02f2f; --t-icon: #c94040; --t-ring: rgba(185, 58, 58, 0.22); }
.contact-type-chip[data-tone="amber"]  { --t-bg: #ffe9b8; --t-mid: #ffe0a0; --t-deep: #a56a08; --t-ink: #85560a; --t-icon: #b8790d; --t-ring: rgba(165, 106, 8, 0.22); }
.contact-type-chip[data-tone="violet"] { --t-bg: #ebdeff; --t-mid: #e0cdff; --t-deep: #6640d0; --t-ink: #5735c0; --t-icon: #7a52e0; --t-ring: rgba(102, 64, 208, 0.22); }

.auth-title {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
}

.auth-title + .auth-note {
  margin-top: -14px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

.account-card.auth-card.wide {
  max-width: 620px;
}

.account-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.account-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
  border: 3px solid var(--color-bg-soft);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.account-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
}

.account-avatar-btn svg {
  width: 16px;
  height: 16px;
}

.account-avatar-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.account-avatar-remove {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

#account-avatar-note.is-error {
  color: var(--color-danger);
}

.account-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin: 0 0 24px;
  padding: 18px 20px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
}

.account-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.account-info-item dt {
  font-size: 12px;
  color: var(--color-text-muted);
}

.account-info-item dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

#account-status-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

#account-status-note.is-error {
  color: var(--color-danger);
}

#account-form input:disabled,
#account-form select:disabled {
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  cursor: default;
  opacity: 1;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.auth-form.grid-2 .full {
  grid-column: 1 / -1;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  background: var(--color-bg);
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.auth-form button[type="submit"] {
  justify-content: center;
  font-weight: 700;
}

.auth-form input.is-invalid,
.auth-form select.is-invalid {
  border-color: var(--color-danger);
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
  margin-top: -2px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-inline-end: 42px;
}

.password-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.forgot-link {
  align-self: flex-end;
  margin-top: -6px;
  font-size: 13px;
  color: var(--color-accent-dark);
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.auth-switch a {
  color: var(--color-accent-dark);
  font-weight: 500;
}

@media (max-width: 640px) {
  .auth-form.grid-2 {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .account-info-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-note,
  .auth-switch {
    font-size: 14px;
  }

  .auth-form {
    gap: 18px;
  }

  .auth-form label {
    font-size: 15px;
    gap: 8px;
  }

  .auth-form input,
  .auth-form select,
  .auth-form textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  .field-error {
    font-size: 13px;
  }
}

.auth-message {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
}
.auth-message.is-error {
  background: #fbe9e7;
  color: #b3261e;
}

.president-section {
  background: var(--color-bg);
  padding: 64px 0 96px;
}

.president-message {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  max-width: 680px;
  margin-inline: auto;
}

.president-quote-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  line-height: 1;
  color: var(--color-accent-light);
  margin-bottom: -8px;
}

.president-photo {
  flex-shrink: 0;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--color-bg-card);
  border: 3px solid var(--color-bg-card);
  outline: 2px solid var(--color-accent-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.president-photo svg {
  width: 50px;
  height: 50px;
}

.president-message strong {
  display: block;
  margin-top: 18px;
  font-size: 15px;
  font-family: var(--font-display);
}

.president-quote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.75;
  color: var(--color-text);
  margin: 6px 0 0;
}

/* غلاف الاسم/الصفة موجود لأجل تخطيط الجوال فقط — display:contents يذيبه هنا فيبقى
   الاسم والصفة عنصرين مباشرين داخل .president-message تماماً كما كانا. */
.president-identity {
  display: contents;
}

.history-map {
  display: none;
}

@media (max-width: 640px) {
  /* A compact "metro map" of the page's four stops — the signature mobile treatment for
     this page. Purely navigational (real anchor links to the real sections below, native
     smooth-scroll from html{scroll-behavior:smooth}); the "interactive" part is the active
     stop tracking scroll position via IntersectionObserver in js/history.js. */
  .history-map {
    display: block;
    background: var(--color-bg-soft);
    border-bottom: 1px solid var(--color-border);
    padding: 18px 20px 16px;
  }

  .history-map-track {
    position: relative;
    display: flex;
    justify-content: space-between;
  }

  .history-map-track::before {
    content: "";
    position: absolute;
    top: 19px;
    inset-inline: 19px;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
  }

  .history-map-stop {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    flex: 1;
  }

  .history-map-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--duration-base) var(--ease-out),
      border-color var(--duration-base) var(--ease-out),
      color var(--duration-base) var(--ease-out),
      box-shadow var(--duration-base) var(--ease-out);
  }

  .history-map-dot svg {
    width: 17px;
    height: 17px;
  }

  .history-map-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
  }

  .history-map-stop.is-active .history-map-dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--color-accent-light);
  }

  .history-map-stop.is-active .history-map-label {
    color: var(--color-accent-dark);
  }
}

.history-section-title {
  font-size: 22px;
  margin-bottom: 16px;
}

.history-about {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-about-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin: 0;
}

.history-about-item h3 {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.history-about-item p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-text);
  white-space: pre-line;
  margin: 0;
}

.history-figures-section {
  background: var(--color-bg-soft);
}

.history-figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.history-figure-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.history-figure-photo {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-figure-photo svg {
  width: 40px;
  height: 40px;
}

.history-figure-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-figure-name {
  font-size: 16px;
  margin: 0 0 6px;
}

.history-figure-bio,
.history-figure-achievements {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--color-text-muted);
  margin: 10px 0 0;
  text-align: start;
}

.history-figure-achievements strong {
  color: var(--color-text);
}

.history-contribute-section .auth-form {
  max-width: 620px;
}

.vm-box {
  max-width: 640px;
  margin-inline-end: auto;
}

.vm-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 32px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.vm-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 14px;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
}

.vm-tab.active {
  color: var(--color-accent-dark);
  font-weight: 700;
  border-bottom-color: var(--color-accent);
}

.vm-panel h2 {
  margin-bottom: 12px;
}

.vm-panel p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .president-section {
    padding: 48px 0 56px;
  }

  .president-quote {
    font-size: 18px;
  }

  .vm-tabs {
    gap: 20px;
    justify-content: center;
  }
}

.album-folder { margin-bottom: 40px; }
.album-folder:last-child { margin-bottom: 0; }

.video-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---------- Folder browsing: category → folder cards → folder detail ---------- */
.album-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* بطاقة المجلد صارت أيقونة ملوّنة لا صورة غلاف: الغلاف كان يعرض أول صورة داخل المجلد،
   فتتشابه المجلدات ويصعب تمييزها بلمحة — واللون + أيقونة المجلد أوضح وأسرع تحميلاً.
   الدرجات نفسها المستخدمة في بطاقات "القائمة" بالصفحة الرئيسية. */
.album-folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: start;
  padding: 16px 15px;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--t-bg, var(--color-bg-soft));
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.album-folder-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.album-folder-card:active { transform: translateY(0); }

.album-folder-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.18);
  color: var(--t-icon, var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-folder-icon svg { width: 25px; height: 25px; }

.album-folder-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--t-ink, var(--color-text));
  /* اسم طويل يُقصّ بسطرين بدل أن يمدّ البطاقة ويكسر انتظام الشبكة. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.album-folder-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t-ink, var(--color-text-muted));
  opacity: 0.72;
}

.album-folder-card[data-tone="indigo"] { --t-bg: #dbe4ff; --t-icon: #3b53c9; --t-ink: #2b3f96; }
.album-folder-card[data-tone="rose"]   { --t-bg: #ffdede; --t-icon: #c94040; --t-ink: #a02f2f; }
.album-folder-card[data-tone="teal"]   { --t-bg: #c9f2ec; --t-icon: #12897f; --t-ink: #0c5f59; }
.album-folder-card[data-tone="amber"]  { --t-bg: #ffe9b8; --t-icon: #b8790d; --t-ink: #85560a; }
.album-folder-card[data-tone="violet"] { --t-bg: #ebdeff; --t-icon: #7a52e0; --t-ink: #5735c0; }
.album-folder-card[data-tone="sienna"] { --t-bg: #ffe0cc; --t-icon: #b35f2c; --t-ink: #8a4520; }
.album-folder-card[data-tone="ocean"]  { --t-bg: #d2eafc; --t-icon: #1c7fa8; --t-ink: #14597a; }
.album-folder-card[data-tone="plum"]   { --t-bg: #ffd9ee; --t-icon: #c04a90; --t-ink: #93306a; }

/* واجهة يوتيوب: صورة مصغّرة + زر تشغيل، والمشغّل الحقيقي يُحقن عند النقر. */
.yt-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: #000;
  cursor: pointer;
  display: block;
}

.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--duration-base) var(--ease-out);
}

.yt-facade:hover .yt-thumb { opacity: 0.85; }

.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(210, 20, 20, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6);
  transition: transform var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.yt-play svg { width: 26px; height: 26px; margin-inline-start: 3px; }
.yt-facade:hover .yt-play { transform: translate(-50%, -50%) scale(1.08); background: #d21414; }

.album-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.album-detail-header h2 { margin: 0; }
.album-detail-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 7px 14px 7px 10px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.album-detail-back:hover { border-color: var(--color-accent); color: var(--color-accent-dark); }

.album-photo-link {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  padding: 0;
  background: none;
  cursor: pointer;
}
.album-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 20, 19, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
}
.lightbox-close {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .2s ease-out;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }

/* Physical left/right (not logical inline-start/end) on purpose: the arrows themselves point
   a physical direction, and flipping their position in RTL without flipping the icon shape
   would put a left-pointing "previous" arrow on the right edge — backwards regardless of
   reading direction, since these browse a flat sequence rather than following text flow. */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .2s ease-out;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox-nav-prev { left: 20px; }
.lightbox-nav-next { right: 20px; }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
}

.lightbox-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #ffffff;
  animation: lightbox-spin .8s linear infinite;
}
@keyframes lightbox-spin { to { transform: rotate(360deg); } }

.lightbox-error {
  color: #ffffff;
  font-size: 14px;
  text-align: center;
}
.lightbox-error a { color: #ffd9a8; text-decoration: underline; }

.album-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-soft);
}
.album-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.events-filter-row { margin-bottom: 20px; display: flex; justify-content: flex-start; }
.events-filter-select {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--color-bg-card);
  min-width: 160px;
}

/* News (الأخبار) — card grid template: cover photo on top, then date (small, right-aligned)
   → title → excerpt → a "read the article"/share footer row. Reused as-is for events.html's
   cards (same visual template, minus the read/share row — events have no article body). */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.news-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(43, 38, 32, 0.08);
  border-color: var(--color-accent);
}
.news-card-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.news-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.news-card-date { font-size: 12.5px; color: var(--color-text-muted); margin: 0; text-align: right; }
.news-card-body h3 { margin: 0; font-size: 18px; }
.news-card-text {
  margin: 0;
  line-height: 1.8;
  color: var(--color-text-muted);
  font-size: 14.5px;
  flex: 1;
  /* Excerpt is already truncated in JS (word-boundary + "…"), this is just a layout backstop
     in case a very long single word or a wider viewport leaves more room than expected. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.news-card-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  padding: 0;
  background: none;
  cursor: zoom-in;
}
.news-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.news-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
/* Was previously split across ".update-card-btn news-card-read-btn" — the former belonged to
   the homepage's deleted "آخر الأحداث" cards, so its visual styling is folded in here and
   this is now the single owner of the pill button. */
.news-card-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.news-card-read-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.news-card-read-btn svg {
  width: 14px;
  height: 14px;
}

.news-share-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  position: relative;
}
.news-share-btn svg { width: 17px; height: 17px; }
.news-share-btn .share-copied-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.news-share-btn.is-copied .share-copied-tip { opacity: 1; }

/* ---------- Single-article page (toggled via ?article=ID — a real page state, not a modal;
   "قراءة الخبر" opens it in a new tab so the article reads as its own page) ---------- */
.article-page {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.article-page-gallery { display: flex; flex-direction: column; gap: 10px; }
.article-page-main-photo {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
}
.article-page-main-photo img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}
/* Thumbnails sit BELOW the main photo, one row, click to switch which photo is main — a
   classic product-gallery pattern, requested explicitly instead of the flat photo grid the
   modal version used. */
.article-page-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.article-page-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s ease;
}
.article-page-thumb.active { border-color: var(--color-accent); }
.article-page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-page-text { margin: 0; line-height: 1.9; color: var(--color-text); white-space: pre-line; }

@media (max-width: 640px) {
  .news-list { grid-template-columns: 1fr; }
}

/* Survey page (survey.html) — scoped overrides so the shared .auth-card/.auth-section
   components stay untouched for login/register/forgot-password/contact. Trimmed vertical
   padding and full-width tap-friendly choice rows read better on a phone than the
   desktop-sized auth card with wrapped chip options. */
.survey-page .auth-section { padding: 48px 0; }
.survey-page .auth-card.wide { padding: 28px; }
.survey-title { font-size: 22px; margin: 0 0 6px; text-wrap: balance; }
.survey-desc { margin: 0 0 22px; color: var(--color-text-muted); font-size: 14px; line-height: 1.7; }

.survey-question-fieldset { border: none; padding: 0; margin: 0; }
.survey-question-fieldset legend {
  width: 100%;
  padding: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.6;
}
.survey-choice-group { display: flex; flex-direction: column; gap: 10px; }
/* label.survey-choice (element+class) is needed to out-specificity the generic
   ".auth-form label { flex-direction: column }" rule above — without it these rows
   inherit a column layout and stack the indicator above the text. */
label.survey-choice {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.survey-choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.survey-choice-indicator {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.survey-choice.is-radio .survey-choice-indicator { border-radius: 50%; }
.survey-choice.is-checkbox .survey-choice-indicator { border-radius: 6px; }
.survey-choice-indicator::after {
  content: "";
  display: block;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.survey-choice.is-radio .survey-choice-indicator::after {
  width: 10px;
  height: 10px;
  margin: 4px;
  border-radius: 50%;
  background: #ffffff;
}
.survey-choice.is-checkbox .survey-choice-indicator::after {
  width: 5px;
  height: 9px;
  margin: 2px auto;
  /* Physical borders on purpose: a checkmark's shape is geometric, not text-direction-
     relative — border-inline-end/block-end would swap sides under RTL and draw the
     rotated corner backwards, mirroring the check instead of drawing a normal ✓. */
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}
.survey-choice:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.survey-choice:has(input:checked) .survey-choice-indicator {
  border-color: var(--color-accent);
  background: var(--color-accent);
}
.survey-choice:has(input:checked) .survey-choice-indicator::after { opacity: 1; }
.survey-choice-label { flex: 1; }

.survey-submitted-note { font-size: 15px; line-height: 1.8; }

.survey-cover-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

/* ---------- trip-event.html (رحلة/فعالية): نفس بطاقة الاستبيان (.auth-card.wide) لكن مع
   صورة غلاف اختيارية وشبكة معلومات بالأيقونات بدل النص الخام، لتنظيم العرض للمشارك. ---------- */
.trip-event-cover {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.trip-event-head {
  margin-bottom: 20px;
}

.trip-event-head .survey-title {
  margin-top: 10px;
}

.trip-event-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.trip-event-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
}

.trip-event-info-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trip-event-info-icon svg {
  width: 17px;
  height: 17px;
}

.trip-event-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trip-event-info-label {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.trip-event-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-event-form-heading {
  font-size: 17px;
  margin: 0 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.trip-event-iban-block {
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.trip-event-iban-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin-bottom: 8px;
}

.trip-event-iban-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trip-event-iban-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  overflow-x: auto;
  white-space: nowrap;
}

.trip-event-iban-copy {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent-dark);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.trip-event-iban-copy:hover {
  background: var(--color-accent);
  color: #ffffff;
}

.trip-event-iban-holder {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

@media (max-width: 480px) {
  .trip-event-info-grid {
    grid-template-columns: 1fr;
  }
}
.survey-deadline-note {
  font-size: 13px;
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0 0 20px;
}
.survey-question-note-text {
  margin: -6px 0 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.survey-participant-note-label {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.survey-participant-note-label textarea {
  margin-top: 6px;
}

@media (max-width: 640px) {
  .survey-page .auth-section { padding: 20px 0 40px; }
  .survey-page .auth-container { padding: 0 12px; }
  .survey-page .auth-card.wide { padding: 20px 16px; }
  .survey-title { font-size: 20px; }
  .survey-choice { padding: 14px; font-size: 15.5px; min-height: 48px; }
  .auth-form label { font-size: 14px; }
}

/* ---------- شجرة العائلة: لوحة تفاعلية (سحب/تكبير) — عرض فقط، منقولة من لوحة التحكم
   بنفس أسماء الأصناف لتبقى ملفات JS متطابقة، مع ألوان/ظلال الموقع العام بدل الداخلية. ---------- */
.tree-auth-gate { text-align: center; }
.tree-auth-gate svg { width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 4px; color: var(--color-accent); }
.tree-auth-gate p { margin: 10px 0 16px; }

.tree-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tree-toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
/* "توسيع الكل"/"طي الكل" always sit on one line together — only the search input wraps
   onto its own line on narrow screens, since it can shrink/grow but these two buttons
   shouldn't split apart from each other. */
.tree-toolbar-expand-group { display: flex; gap: 8px; flex-wrap: nowrap; flex-shrink: 0; }
.tree-search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--color-bg-card);
}
/* غلاف حقل البحث + علامة «!» التي تشرح ترتيب الأسماء (الفرد ← الأب ← الجد ← أب الجد).
   الغلاف هو من يحمل flex/max-width الآن بدل الحقل نفسه، والحقل يملأه. */
.tree-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 180px;
  max-width: 340px;
}

.tree-search-wrap .tree-search-input {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.tree-search-hint-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.tree-search-hint-btn:hover,
.tree-search-hint-btn.is-open {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.tree-search-hint {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 20;
  width: min(310px, 80vw);
  padding: 14px 16px;
  text-align: start;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.tree-search-hint strong {
  display: block;
  font-size: 14px;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.tree-search-hint p {
  margin: 0 0 9px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--color-text-muted);
}

.tree-search-hint p:last-child { margin-bottom: 0; }

.tree-hint-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.tree-hint-order span {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.tree-hint-example b { color: var(--color-text); font-weight: 700; }
.tree-hint-note { font-size: 11.5px; }

/* ==========================================================================
   بطاقة "تواصل معنا" فوق الفوتر — نسخة الجوال فقط
   ========================================================================== */
.home-contact {
  display: none;
}

@media (max-width: 640px) {
  .home-contact {
    display: block;
    padding: 28px 0 6px;
  }

  /* كل ما فوقها في الصفحة بطاقات فاتحة على أبيض؛ فجعلُها السطح المصمت الوحيد هو ما
     يجعل العين تقع عليها فوراً. أخضر الهوية نفسه (--color-accent) لكن بدرجة غامقة
     مصمتة بدل الفاتحة المستخدمة في بقية البطاقات — فتبقى مميّزة كدعوة أخيرة قبل
     الفوتر مع بقائها ضمن نفس هوية الموقع لا لوناً غريباً عنها. */
  .hc-card {
    --hc-ink: #0b443f;
    --hc-mid: #0f5c56;
    --hc-lift: #23a08f;
    --hc-glow: #f9bd5c;

    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--hc-mid) 0%, var(--hc-ink) 62%, #052220 100%);
    box-shadow: 0 16px 32px -16px rgba(11, 68, 63, 0.62),
      0 2px 6px -3px rgba(11, 68, 63, 0.45);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* لا transition هنا عمداً: البطاقة تحمل .reveal التي تنتقل على transform/opacity،
     وأي transition بنفس الترجيح هنا يأتي لاحقاً في الملف فيلغي ظهورها بالكامل.
     لذلك أثر الضغط على filter (خارج قائمة .reveal) فيستجيب فوراً بلا تعارض. */
  .hc-card:active { filter: brightness(1.16); }

  /* شفق بطيء يتنقّل داخل اللوحة — حياة دائمة خفيفة لا حركة صارخة. */
  .hc-card::before {
    content: "";
    position: absolute;
    inset: -45% -25%;
    z-index: -1;
    background:
      radial-gradient(38% 56% at 24% 28%, rgba(35, 160, 143, 0.85) 0%, rgba(35, 160, 143, 0) 70%),
      radial-gradient(34% 50% at 76% 74%, rgba(249, 189, 92, 0.3) 0%, rgba(249, 189, 92, 0) 72%);
    animation-name: hcAurora;
    animation-duration: 16s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
  }

  /* لمعة تعبر اللوحة كل ~٦ ثوانٍ باتجاه القراءة (يمين← يسار) ثم تختفي وتنتظر.
     هذه هي اللمسة المميّزة الوحيدة — وما عداها هادئ حتى تبقى مؤثّرة. */
  .hc-card::after {
    content: "";
    position: absolute;
    inset-block: -60%;
    inset-inline: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(255deg,
      rgba(255, 255, 255, 0) 42%,
      rgba(255, 255, 255, 0.34) 50%,
      rgba(255, 255, 255, 0) 58%);
    transform: translateX(100%);
    animation-name: hcSheen;
    animation-duration: 6s;
    animation-timing-function: cubic-bezier(0.55, 0, 0.2, 1);
    animation-iteration-count: infinite;
  }

  .hc-icon {
    flex: 0 0 auto;
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--hc-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px -7px rgba(0, 0, 0, 0.5);
    transition: transform var(--duration-base) var(--ease-out);
  }

  /* هالة كهرمانية تتنفّس خلف لوحة الأيقونة. */
  .hc-icon::before {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;
    border-radius: 21px;
    background: radial-gradient(circle, rgba(249, 189, 92, 0.6) 0%, rgba(249, 189, 92, 0) 70%);
    animation-name: hcHalo;
    animation-duration: 3.6s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }

  .hc-icon svg { width: 24px; height: 24px; }
  .hc-card:active .hc-icon { transform: scale(1.09); }

  /* طيّة المظروف تُرسم من جديد مع كل دورة — الرسالة تُكتب ثم تُرسل. الإعادة إلى
     الحالة غير المرسومة تحدث والطيّة شفافة، حتى لا تظهر قفزة عند حدّ الدورة. */
  .hc-flap {
    stroke-dasharray: 24;
    animation-name: hcFlap;
    animation-duration: 6s;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
    animation-iteration-count: infinite;
  }

  .hc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .hc-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
  }

  .hc-sub {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
  }

  .hc-go {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--hc-glow);
    animation-name: hcNudge;
    animation-duration: 2.6s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }
}

/* الحركات معرّفة خارج @media حتى تبقى في مكان واحد؛ ولا تُستعمل صيغة animation
   المختصرة مع var() في خانة التوقيت لأنها تُبطل التصريح كاملاً بصمت. */
@keyframes hcAurora {
  from { transform: translate3d(-6%, -4%, 0) scale(1); }
  to   { transform: translate3d(7%, 5%, 0) scale(1.12); }
}

@keyframes hcSheen {
  0%        { transform: translateX(100%); }
  55%, 100% { transform: translateX(-100%); }
}

@keyframes hcHalo {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

@keyframes hcFlap {
  0%       { stroke-dashoffset: 24; opacity: 0; }
  6%       { stroke-dashoffset: 24; opacity: 1; }
  26%      { stroke-dashoffset: 0;  opacity: 1; }
  92%      { stroke-dashoffset: 0;  opacity: 1; }
  100%     { stroke-dashoffset: 0;  opacity: 0; }
}

@keyframes hcNudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .hc-card::before,
  .hc-card::after,
  .hc-icon::before,
  .hc-flap,
  .hc-go {
    animation: none;
  }
  .hc-card::after { opacity: 0; }
  .hc-flap { stroke-dashoffset: 0; opacity: 1; }
}


/* ==========================================================================
   التقويم الهجري على الرئيسية — نسخة الجوال فقط (مثل .quick-launch و .home-news)
   ========================================================================== */
.hijri-cal {
  display: none;
}

@media (max-width: 640px) {
  .hijri-cal {
    display: block;
    padding: 28px 0 0;
  }

  .hijri-cal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 14px;
  }

  /* بطاقة تاريخ اليوم: الأبرز في القسم، فهي الجواب على السؤال الأول "كم التاريخ". */
  .hijri-today {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 18px;
    margin-bottom: 14px;
    border-radius: var(--radius-xl);
    background: linear-gradient(140deg, #0f5c56 0%, #17877a 100%);
    color: #ffffff;
  }

  .hijri-today-label {
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.72);
  }

  .hijri-today-date {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
  }

  .hijri-today-greg {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.78);
  }

  /* ---------- جدول الشهر ---------- */
  .hijri-card {
    padding: 14px 12px 16px;
    margin-bottom: 14px;
    border-radius: var(--radius-xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
  }

  .hijri-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }

  .hijri-month-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-accent);
  }

  .hijri-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .hijri-nav-btn svg { width: 16px; height: 16px; }
  .hijri-nav-btn:active { background: var(--color-accent-light); }

  /* نفس الشبكة للرؤوس والأيام حتى تتطابق الأعمدة تماماً. */
  .hijri-weekdays,
  .hijri-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .hijri-weekdays { margin-bottom: 6px; }

  .hijri-weekday {
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding-bottom: 2px;
  }

  .hijri-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
  }

  .hijri-day.is-blank { visibility: hidden; }

  .hijri-day.has-event {
    background: var(--color-accent-light);
    color: var(--color-accent-dark);
    font-weight: 700;
  }

  /* النقطة تحت الرقم تميّز يوم المناسبة حتى لو لم يُميَّز باللون (طباعة/تباين عالٍ). */
  .hijri-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent);
  }

  /* تمييز نوع المناسبة: الفرح أخضر، والحزن رمادي داكن، وما تضيفه العائلة كهرماني —
     فلا يُقرأ يوم شهادة بنفس لون العيد. */
  .hijri-day.is-mourning { background: #ecedee; color: #3d4548; }
  .hijri-day.is-mourning .hijri-dot { background: #5b6b68; }
  .hijri-day.is-religious { background: #eef3fe; color: #2f4494; }
  .hijri-day.is-religious .hijri-dot { background: #415eb6; }
  .hijri-day.is-custom { background: #fff8e8; color: #85560a; }
  .hijri-day.is-custom .hijri-dot { background: #d98a0b; }

  .hijri-item.is-mourning .hijri-item-date { background: #ecedee; color: #3d4548; }
  .hijri-item.is-religious .hijri-item-date { background: #eef3fe; color: #2f4494; }
  .hijri-item.is-custom .hijri-item-date { background: #fff8e8; color: #85560a; }

  /* شارة النوع بجانب الاسم — مفيدة حين يقع في اليوم أكثر من مناسبة. */
  .hijri-kind {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    vertical-align: middle;
  }

  .hijri-item-title { line-height: 1.6; }

  .hijri-day.is-today {
    background: var(--color-accent);
    color: #ffffff;
    font-weight: 700;
  }

  .hijri-day.is-today .hijri-dot { background: #ffffff; }

  .hijri-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hijri-empty { font-size: 13px; margin: 0; }

  .hijri-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
  }

  /* مربّع اليوم/الشهر بعرض ثابت حتى تصطفّ عناوين المناسبات على خط واحد. */
  .hijri-item-date {
    flex: 0 0 auto;
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 4px;
    border-radius: var(--radius-md);
    background: var(--color-accent-light);
    color: var(--color-accent-dark);
  }

  .hijri-item-date b { font-size: 16px; font-weight: 700; line-height: 1; }
  .hijri-item-date span { font-size: 10px; text-align: center; line-height: 1.25; }

  .hijri-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .hijri-item-title { font-size: 14px; font-weight: 600; }
  .hijri-item-greg { font-size: 11.5px; color: var(--color-text-muted); }
  .hijri-item-note { font-size: 11.5px; color: var(--color-text-muted); }

  .hijri-item-countdown {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
  }

  /* مناسبة اليوم تُميَّز بلون الهوية لا بحجم أكبر، حتى لا يختلّ إيقاع الصف. */
  .hijri-item.is-today {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
  }

  .hijri-item.is-today .hijri-item-date {
    background: var(--color-accent);
    color: #ffffff;
  }

  .hijri-item.is-today .hijri-item-countdown { color: var(--color-accent-dark); }

  /* المناسبات المضافة من لوحة التحكم تُميَّز بشريط جانبي كهرماني. */
  .hijri-item.is-custom {
    border-inline-start: 3px solid #d98a0b;
  }

  .hijri-note {
    margin: 4px 0 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--color-text-muted);
  }
}

/* بطاقة هوية المشارك في الاستبيان (survey.html) — تحلّ محل حقول الاسم/الجوال/البريد
   للعضو المسجّل: يرى بأي بيانات سُتسجَّل مشاركته بدل أن يعيد كتابتها. */
.survey-identity {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  margin-bottom: 6px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.survey-identity-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-accent);
}

.survey-identity-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
}

.survey-identity-label {
  flex: 0 0 auto;
  min-width: 92px;
  color: var(--color-text-muted);
  font-size: 12.5px;
}

.survey-identity-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.survey-identity-edit {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: underline;
}

/* قوائم الأعضاء (trips.html / surveys.html) — تعيد استخدام .news-card بالكامل،
   ولا تضيف إلا حالة "مغلق" ورابط تسجيل الدخول في رسالة الحجب. */
.member-card-item.is-closed { opacity: 0.72; }

.member-closed-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.member-list-login {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
}

.tree-meta { font-size: 13px; color: var(--color-text-muted); margin: 0 0 10px; }

.tree-canvas-wrap {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, var(--color-bg-soft) 0%, var(--color-bg) 65%);
}
.tree-canvas-wrap.is-maximized {
  position: fixed;
  inset: 12px;
  width: auto;
  height: auto;
  z-index: 500;
  box-shadow: 0 20px 60px -20px rgba(15, 92, 86, .4);
}

/* Explicit close affordance for the maximized view — physically top-left regardless of
   RTL (not inset-inline-start), since that's the corner people expect a fullscreen "×" in
   regardless of page direction. Escape/backdrop-click/the toolbar button already exit too;
   this is just a more obvious one. Only ever visible while actually maximized. */
.tree-maximize-close {
  display: none;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 501;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-card);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.tree-maximize-close svg {
  width: 18px;
  height: 18px;
}
.tree-maximize-close:hover {
  background: var(--color-accent);
  color: #ffffff;
}
.tree-canvas-wrap.is-maximized .tree-maximize-close {
  display: flex;
}

/* Whiteboard-style viewport: no native scrolling. .tree-canvas is positioned with a single
   translate()+scale() transform driven from JS (panX/panY/scale). */
.tree-scroll-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  border-radius: inherit;
}
.tree-scroll-area.dragging { cursor: grabbing; }
.tree-maximize-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 92, 86, .35);
  z-index: 400;
}
.tree-maximize-backdrop.visible { display: block; }
.tree-canvas {
  position: absolute;
  top: 0;
  left: 0;
  padding: 56px 48px 70px;
  transform-origin: 0 0;
  box-sizing: border-box;
  touch-action: none;
  will-change: transform;
}

.tree-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.tree-connectors path { fill: none; stroke: var(--color-border); stroke-width: 2; }

.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree { position: relative; display: flex; justify-content: center; z-index: 1; }
.org-tree ul { position: relative; display: flex; justify-content: center; padding-top: 44px; z-index: 1; }
.org-tree li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding: 0 22px;
}
.org-tree li.has-children { padding-bottom: 10px; }
.org-tree li.collapsed > ul { display: none; }

/* Regular rounded-rectangle card (not a full pill) — avatar beside the name/birth-year. */
.org-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  width: auto;
  min-width: 168px;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: 0 4px 10px -4px rgba(15, 92, 86, .12);
  transition: border-color .2s ease-out, transform .2s ease-out, box-shadow .2s ease-out;
}
.org-card:hover { border-color: var(--color-accent); transform: translateY(-2px); box-shadow: 0 8px 18px -6px rgba(15, 92, 86, .22); }
.org-card.root { border: 2px solid var(--color-accent); background: var(--color-accent-light); min-width: 184px; }

.org-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.org-card.root .org-avatar { background: #ffffff; width: 50px; height: 50px; font-size: 16px; }
.org-card-body { text-align: start; overflow: hidden; }
.org-name { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; line-height: 1.25; }
.org-sub { display: block; font-size: 11.5px; color: var(--color-text-muted); margin-top: 1px; }

/* Desktop: a noticeably bigger template, per request. */
@media (min-width: 900px) {
  .org-card { padding: 16px 20px; gap: 14px; min-width: 208px; }
  .org-card.root { min-width: 226px; }
  .org-avatar { width: 54px; height: 54px; font-size: 17px; }
  .org-card.root .org-avatar { width: 60px; height: 60px; font-size: 18px; }
  .org-name { font-size: 15px; max-width: 170px; }
  .org-sub { font-size: 12.5px; }
}

.org-toggle {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  border: 2px solid var(--color-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  padding: 0;
}
.org-tree li:not(.has-children) .org-toggle { display: none; }
.org-tree li.collapsed .org-toggle svg { transform: rotate(180deg); }
.org-toggle svg { width: 13px; height: 13px; transition: transform .2s ease-out; }

.org-tree li.search-hit .org-card {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light), 0 8px 18px -6px rgba(15, 92, 86, .3);
  animation: treePulseGlow 1.4s ease-in-out 2;
}
@keyframes treePulseGlow {
  0%, 100% { box-shadow: 0 0 0 3px var(--color-accent-light); }
  50% { box-shadow: 0 0 0 6px var(--color-accent-light); }
}

/* النتيجة الأولى للبحث: لون كهرماني مختلف عمداً عن الأخضر المستخدم في كل مكان
   (وعن .search-hit نفسها) حتى تُميَّز البطاقة المقصودة عن بقية المطابقات. تبقى
   عشر ثوانٍ ثم تُزال من js/tree.js. تأتي بعد .search-hit في الملف لتتغلّب عليها. */
.org-tree li.search-focus .org-card {
  border-color: #d98a0b;
  background: #fff8e8;
  box-shadow: 0 0 0 4px rgba(217, 138, 11, 0.24), 0 10px 22px -8px rgba(217, 138, 11, 0.5);
  /* نبض قصير في البداية يلفت النظر، ثم يثبت اللون بقية المدة بدل وميض مستمر
     عشر ثوانٍ. الصيغة المطوّلة لا المختصرة — المختصرة مع var() تُبطل الإعلان. */
  animation-name: treeFocusPulse;
  animation-duration: 1.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 4;
}

.org-tree li.search-focus .org-name {
  color: #8a5a00;
}

@keyframes treeFocusPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(217, 138, 11, 0.24), 0 10px 22px -8px rgba(217, 138, 11, 0.5); }
  50% { box-shadow: 0 0 0 9px rgba(217, 138, 11, 0.16), 0 10px 22px -8px rgba(217, 138, 11, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .org-tree li.search-focus .org-card { animation-name: none; }
}
.org-tree li[hidden] { display: none; }

.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 10px 24px rgba(43, 38, 32, 0.08);
  z-index: 10;
}
.zoom-controls .icon-btn { width: 34px; height: 34px; border: none; background: transparent; }
.zoom-controls .zoom-divider { height: 1px; background: var(--color-border); margin: 2px 4px; }

.tree-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(43, 38, 32, 0.08);
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
}
.tree-legend b { color: var(--color-text); font-weight: 700; }
.tree-legend .legend-root { display: flex; align-items: center; gap: 6px; }
.tree-legend .legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); flex-shrink: 0; }

@media (max-width: 640px) {
  .tree-legend { display: none; }
}

/* ---------- Modal (read-only person details) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 92, 86, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  width: min(440px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 70px -20px rgba(15, 92, 86, .35);
}
.modal-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
}
.modal-close:hover { background: var(--color-border); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
  flex-shrink: 0;
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.modal-field { background: var(--color-bg-soft); border-radius: var(--radius-md); padding: 10px 13px; }
.modal-field span { display: block; font-size: 11px; color: var(--color-text-muted); margin-bottom: 3px; }
.modal-field b { font-size: 13.5px; font-weight: 600; }
.modal-children h4 { font-size: 13px; color: var(--color-text-muted); margin-bottom: 10px; font-weight: 600; }
.children-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--color-accent-light); color: var(--color-accent-dark); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 999px; }
.no-children { font-size: 13px; color: var(--color-text-muted); }

/* ==========================================================================
   لوحة الوصول السريع "القائمة" — نسخة الجوال فقط (index.html)
   ==========================================================================
   بديل زرّي الهيرو على الجوال: كل أقسام الموقع تظهر دفعة واحدة كشبكة بدل
   شريط أفقي يخفي نصف البطاقات خلف الحافة (التمرير الأفقي يخفي المحتوى ولا
   يعطي أي إشارة لعدد ما تبقى). مخفية كلياً على الشاشات الأكبر — التنقّل هناك
   يتم عبر شريط التنقّل العلوي الظاهر أصلاً.

   ملاحظة تباين: درجة الكهرماني في التصور الأصلي (#FFB110) على خلفية فاتحة
   تعطي تبايناً ~1.9:1 — أي نص غير مقروء عملياً. لذلك نصّ كل بطاقة هنا يستخدم
   درجة داكنة من نفس اللون (--t-ink ≥ 4.5:1) والأيقونة درجة متوسطة (≥ 3:1)،
   مع الحفاظ على نفس هوية الألوان. */

.quick-launch {
  display: none;
}

/* ==========================================================================
   آخر الأخبار على الرئيسية (index.html) — نسخة الجوال فقط، مثل .quick-launch
   ========================================================================== */

.home-news {
  display: none;
}

.home-news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.home-news-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
}

.home-news-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
}

.home-news-all svg {
  width: 15px;
  height: 15px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.home-news-all:hover svg {
  transform: translateX(-3px);
}

.home-news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.home-news-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.home-news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.home-news-thumb {
  flex: 0 0 auto;
  width: 92px;
  align-self: stretch;
  min-height: 92px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-soft);
}

.home-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-news-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.home-news-thumb.is-empty svg {
  width: 30px;
  height: 30px;
}

.home-news-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 2px 0;
}

.home-news-date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.home-news-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  /* العناوين الطويلة تُقصّ عند سطرين حتى تبقى البطاقات بارتفاع متقارب في الشبكة. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-news-excerpt {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .home-news {
    display: block;
    padding: 28px 0 0;
  }

  .home-news-head h2 {
    font-size: 18px;
  }

  .home-news-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-news-thumb {
    width: 84px;
    min-height: 84px;
  }
}

@media (max-width: 640px) {
  .quick-launch {
    display: block;
    padding: 30px 0 0;
  }

  /* زرّا الهيرو ("استكشف شجرة العائلة" / "تعرف على تاريخ العائلة") يكرران
     وجهتين موجودتين أصلاً في الشبكة أدناه — إخفاؤهما على الجوال يحذف التكرار
     ويقصّر الهيرو الطويل بدل أن يخسر المستخدم أي رابط. */
  .hero-actions {
    display: none;
  }

  .hero {
    padding: 64px 0 34px;
  }

  .hero-sub {
    margin-bottom: 0;
  }

  .hero-scroll-cue {
    margin-top: 26px;
  }

  .quick-launch-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 14px;
  }

  .ql-tile {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* الضغط يُعبَّر عنه بتغميق الخلفية لا بـ transform: البطاقات تدخل بحركة
     translateY عبر .reveal، وأي transform في :active كان بيتصادم معها
     (ويزحزح حدود العنصر أثناء اللمس). */
  .ql-tile:active {
    filter: brightness(0.955);
  }

  /* دخول متتابع: كل بطاقة تتأخر 55ms عن سابقتها فتتوالى البطاقات بدل أن تظهر
     دفعة واحدة. نضيف scale بسيطاً فوق الـ translateY الافتراضي في .reveal
     ليصبح الدخول "طلوعاً" لا مجرد انزلاق. */
  .ql-tile.reveal {
    transform: translateY(18px) scale(0.96);
    transition-delay: calc(var(--i, 0) * 55ms);
  }

  .ql-tile.reveal.reveal-visible {
    transform: none;
  }

  /* ---------- البطاقة العريضة: مجلس العائلة ---------- */
  .ql-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-accent-light) 100%);
    border: 1px solid var(--color-accent-light);
    box-shadow: var(--shadow-sm);
  }

  .ql-feature-emblem {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* الشعار الآن SVG مضمّن لا صورة: color هو ما يلوّنه (عبر fill="currentColor")،
     فيتماشى مع أخضر البطاقة بدل برتقالي ملف PNG. */
  .ql-feature-emblem .ql-emblem-mark {
    width: 34px;
    height: auto;
    display: block;
    color: var(--color-accent);
  }

  .ql-feature-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .ql-feature-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-accent);
  }

  .ql-feature-sub {
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
  }

  .ql-feature-go {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--color-accent);
    opacity: 0.5;
  }

  /* ---------- الشبكة ---------- */
  .ql-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .ql-grid .ql-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-height: 112px;
    padding: 15px 14px;
    border-radius: var(--radius-xl);
    background: var(--t-bg);
  }

  .ql-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--t-icon);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ql-icon svg {
    width: 22px;
    height: 22px;
  }

  .ql-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--t-ink);
  }

  .ql-tile[data-tone="indigo"] { --t-bg: #eef3fe; --t-icon: #415eb6; --t-ink: #2f4494; }
  .ql-tile[data-tone="rose"]   { --t-bg: #fdefef; --t-icon: #ac4141; --t-ink: #8c3434; }
  .ql-tile[data-tone="teal"]   { --t-bg: #e8f7f7; --t-icon: #12928f; --t-ink: #0f5f5d; }
  .ql-tile[data-tone="amber"]  { --t-bg: #fff8e8; --t-icon: #c77a05; --t-ink: #8a5a00; }
  .ql-tile[data-tone="violet"] { --t-bg: #f2effc; --t-icon: #6d5bd0; --t-ink: #4f3fa8; }
  .ql-tile[data-tone="sienna"] { --t-bg: #fbf0e8; --t-icon: #a65b2a; --t-ink: #7e4420; }
  .ql-tile[data-tone="ocean"]  { --t-bg: #e9f4fb; --t-icon: #1f7fa8; --t-ink: #15607f; }
  .ql-tile[data-tone="plum"]   { --t-bg: #fbeef5; --t-icon: #a8437c; --t-ink: #85315f; }

  /* [hidden] العام يستخدم !important، لكن .ql-grid يضبط display:flex على البطاقات
     بوزن أعلى — فلولا هذه القاعدة لظهرت بطاقتا الأعضاء للزائر رغم hidden. */
  .ql-grid .ql-tile[hidden] { display: none; }
}

/* ==========================================================================
   كلمة رئيس المجلس — قالب مضغوط (نسخة الجوال فقط)
   ==========================================================================
   النسخة الأصلية كومة عمودية موسّطة: علامة اقتباس 72px، صورة 128px، ثم النص
   بحجم 18px — أكثر من شاشة كاملة لفقرة واحدة. هنا تتحول إلى بطاقة واحدة:
   شارة في الأعلى، ثم صف [صورة صغيرة + الاسم والصفة]، ثم النص تحت فاصل.
   كل القواعد داخل max-width:640px، وتأتي متأخرة في الملف لتتغلّب على قواعد
   .president-* الأقدم (نفس الوزن، والأسبقية للأخير). */
@media (max-width: 640px) {
  /* بوزن ‎(0,2,0)‎ عمداً: القسم صار ملاصقاً للهيرو، فقاعدة ".hero + .content-section"
     غير المشروطة (نفس الوزن) كانت ستفرض 40px على الجوال أيضاً لولا أن هذه متأخرة عنها. */
  .hero + .president-section {
    padding: 28px 0 4px;
  }

  /* شبكة لا flex: مع flex-wrap كان لا بد من إعطاء الشارة flex-basis:100% لتنفرد
     بسطرها، وهذا يمدّ حبّة الشارة نفسها بعرض البطاقة كشريط فارغ. الشبكة تفصل
     "السطر كامل العرض" عن "عرض العنصر"، فتبقى الشارة ملتصقة بنصّها عبر justify-self.

     .president-message هو نفسه عنصر .container — فحشوته الأفقية (24px) تقع داخل
     صندوقه، ولو تركناها لامتدت خلفية البطاقة من حافة الشاشة إلى الأخرى. نحوّلها
     إلى margin، و width:auto ضروري معها لأن ‏.container يضبط width:100% فلو بقي
     لأُضيف الهامشان فوق عرض كامل بدل أن يقتطعا منه — أي تجاوز أفقي للصفحة كلها. */
  .president-message {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "badge    badge"
      "photo identity"
      "quote    quote";
    align-items: center;
    gap: 13px 12px;
    text-align: start;
    width: auto;
    margin: 0 24px;
    padding: 18px;
    max-width: none;
    /* الأخضر الباهت من نظام ألوان الموقع (--color-accent-light) والنص داكن عليه. */
    background: var(--color-accent-light);
    border: 1px solid #c7e4e0;
    border-radius: var(--radius-xl);
    box-shadow: none;
  }

  .president-message .badge {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #c7e4e0;
    color: var(--color-accent-dark);
  }

  .president-message strong { color: var(--color-text); }
  .president-identity .text-muted { color: var(--color-text-muted); }

  .president-photo {
    background: #ffffff;
    border-color: #ffffff;
    outline-color: #c7e4e0;
    color: var(--color-accent);
    box-shadow: none;
  }

  .president-quote {
    color: var(--color-text);
    border-top-color: #c7e4e0;
  }

  /* علامة الاقتباس الكبيرة كانت أطول عنصر في القسم بلا مضمون — تُحذف هنا. */
  .president-quote-mark {
    display: none;
  }

  .president-message .badge {
    grid-area: badge;
    justify-self: start;
  }

  .president-photo {
    grid-area: photo;
    width: 46px;
    height: 46px;
    border-width: 2px;
    outline-width: 1px;
    margin-bottom: 0;
  }

  .president-photo svg {
    width: 22px;
    height: 22px;
  }

  /* هنا فقط يصير الغلاف عنصراً حقيقياً (بدل display:contents) ليجلس بجانب الصورة. */
  .president-identity {
    grid-area: identity;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .president-message strong {
    margin-top: 0;
    font-size: 15px;
    line-height: 1.4;
  }

  .president-identity .text-muted {
    font-size: 12.5px;
    line-height: 1.4;
  }

  .president-quote {
    grid-area: quote;
    font-size: 13.5px;
    line-height: 1.85;
    margin: 0;
    padding-top: 13px;
    border-top: 1px solid var(--color-border);
  }
}

/* ==========================================================================
   تفاعل المسجّلين: إعجاب وتعليقات (js/interactions.js)
   ==========================================================================
   مشتركة بين صفحة الخبر وبطاقات المناسبات — البادئة fx- حتى لا تتصادم مع
   أصناف الأخبار/المناسبات القائمة. */

.fx-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.fx-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.fx-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.fx-like svg {
  width: 17px;
  height: 17px;
  fill: none;
  transition: fill var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.fx-like:hover:not(:disabled) {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.fx-like.is-liked {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: #fdeeed;
}

.fx-like.is-liked svg {
  fill: var(--color-danger);
  transform: scale(1.08);
}

.fx-like:disabled {
  opacity: 0.6;
  cursor: default;
}

.fx-comment-count {
  font-size: 13px;
  color: var(--color-text-muted);
}

.fx-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.fx-empty {
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 0;
}

.fx-comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.fx-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
}

.fx-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fx-comment-body {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  padding: 9px 13px;
}

.fx-comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.fx-comment-author {
  font-size: 13px;
  font-weight: 700;
}

.fx-comment-when {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.fx-comment-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  /* تعليق بكلمة واحدة طويلة (رابط مثلاً) كان يمدّ الفقاعة خارج البطاقة. */
  overflow-wrap: anywhere;
}

.fx-delete {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.fx-delete svg { width: 15px; height: 15px; }

.fx-delete:hover {
  color: var(--color-danger);
  background: #fdeeed;
}

.fx-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.fx-input {
  flex: 1;
  min-width: 0;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  color: var(--color-text);
}

.fx-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.fx-send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.fx-send svg { width: 18px; height: 18px; }
.fx-send:hover:not(:disabled) { background: var(--color-accent-dark); }
.fx-send:disabled { opacity: 0.55; cursor: default; }

.fx-signin {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.fx-signin a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
}

.fx-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.fx-note.is-error { color: var(--color-danger); }

/* زر فتح/طي التفاعل داخل بطاقة المناسبة */
.fx-toggle {
  background: var(--color-bg-soft);
  color: var(--color-accent-dark);
  box-shadow: none;
}

.fx-toggle:hover {
  background: var(--color-accent-light);
  transform: none;
  box-shadow: none;
}

.fx-toggle.is-open {
  background: var(--color-accent);
  color: #fff;
}

@media (max-width: 640px) {
  .fx-block { margin-top: 18px; padding-top: 14px; }
  .fx-comment-text { font-size: 13px; }
  .fx-input { font-size: 16px; } /* 16px يمنع تكبير iOS التلقائي عند التركيز */
}

/* ==========================================================================
   نسخة الجوال: بانر حيوي وألوان مشبعة (index.html)
   ==========================================================================
   كل ما تحت هذا داخل max-width:640px — نسخة سطح المكتب لا تتأثر بحرف واحد.
   يأتي متأخراً في الملف ليتغلّب على قواعد .hero و .ql-tile السابقة بنفس الوزن. */
@media (max-width: 640px) {
  /* الهيدر والبانر ككتلة بيضاء واحدة: الهيدر بلا خلفية خاصة ولا حد سفلي، والبانر
     يكمله بنفس الأبيض ويحمل وحده الحواف السفلية — فيبدوان قسماً واحداً ينتهي بمنحنى
     من الجانبين بدل شريطين منفصلين. */
  .site-header {
    background: var(--color-bg-card);
    border-bottom: none;
    padding-bottom: 0;
  }

  /* الهيرو نمط تحريري: الخطّ نفسه هو التصميم — شارة صغيرة جداً فوق جملة ضخمة
     مختلفة الأوزان، بلا تدرّجات ولا أشكال تزاحم النص. */
  .hero {
    margin: 0;
    padding: 6px 22px 30px;
    border-radius: 0 0 30px 30px;
    background: var(--color-bg-card);
    border: none;
    box-shadow: 0 10px 24px -18px rgba(15, 92, 86, 0.5);
    text-align: start;
  }

  /* .hero-copy تضبط text-align:center مباشرة على العنصر الابن، فلا يكفي ضبطها على
     .hero بالوراثة — تُنقض هنا صراحةً. */
  .hero-copy {
    text-align: start;
  }

  /* الشارة تتحول من حبّة ملوّنة إلى سطر تعريفي صغير فوق العنوان. */
  .hero .badge {
    display: inline;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
  }

  /* الوزن الخفيف هو الأساس هنا، والثقيل يبرز نصف الجملة — التباين بين الوزنين هو
     ما يصنع الإيقاع، لا اللون وحده. */
  .hero h1 {
    font-size: 30px;
    line-height: 1.36;
    font-weight: 400;
    letter-spacing: -0.015em;
    color: var(--color-text);
    margin: 12px 0 14px;
    text-wrap: balance;
  }

  .hero-accent-word,
  .hero-strong {
    font-weight: 700;
    color: var(--color-accent);
  }

  .hero-sub {
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-text-muted);
    max-width: none;
    margin: 0;
  }

  .hero-scroll-cue {
    margin: 18px auto 0;
    color: var(--color-text-muted);
  }

  /* لا أشكال خلف النص في هذا النمط. */
  .hero-decor {
    display: none;
  }

  /* ---------- بطاقة مجلس العائلة: بنفس طابع البطاقات أسفلها ----------
     خلفية فاتحة مشبعة + نص داكن + لوحة أيقونة بيضاء، تماماً كبقية بطاقات القائمة.
     الدرجة خضراء (هوية المجلس) وأعمق قليلاً من درجة "المناسبات" حتى لا تتطابق معها
     رغم قربهما في العائلة اللونية. */
  .ql-feature {
    background: #bfe8dd;
    border-color: transparent;
    box-shadow: none;
  }

  .ql-feature-label { color: #0b4a44; }
  .ql-feature-sub { color: #3f6b64; }
  .ql-feature-go { color: #0f5c56; opacity: 0.55; }

  /* ---------- درجات البطاقات: أكثر إشباعاً مع إبقاء النص داكناً ---------- */
  .ql-tile[data-tone="indigo"] { --t-bg: #dbe4ff; --t-icon: #3b53c9; --t-ink: #2b3f96; }
  .ql-tile[data-tone="rose"]   { --t-bg: #ffdede; --t-icon: #c94040; --t-ink: #a02f2f; }
  .ql-tile[data-tone="teal"]   { --t-bg: #c9f2ec; --t-icon: #12897f; --t-ink: #0c5f59; }
  .ql-tile[data-tone="amber"]  { --t-bg: #ffe9b8; --t-icon: #b8790d; --t-ink: #85560a; }
  .ql-tile[data-tone="violet"] { --t-bg: #ebdeff; --t-icon: #7a52e0; --t-ink: #5735c0; }
  .ql-tile[data-tone="sienna"] { --t-bg: #ffe0cc; --t-icon: #b35f2c; --t-ink: #8a4520; }
  .ql-tile[data-tone="ocean"]  { --t-bg: #d2eafc; --t-icon: #1c7fa8; --t-ink: #14597a; }
  .ql-tile[data-tone="plum"]   { --t-bg: #ffd9ee; --t-icon: #c04a90; --t-ink: #93306a; }

  /* لوحة الأيقونة بيضاء مصمتة: على خلفية مشبعة صارت الشفافية تُظهرها باهتة.
     الحلقة الملوّنة حولها (box-shadow ثانٍ) تربطها بلون البطاقة بدل أن تطفو عليها. */
  .ql-icon {
    position: relative;
    background: #ffffff;
    box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.45);
    transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
  }

  .ql-icon svg {
    transition: transform var(--duration-base) var(--ease-out);
  }

  /* دخول الأيقونة بحركة مستقلة عن البطاقة: البطاقة تنزلق للأعلى، والأيقونة تدور
     وتكبر داخلها — فيُقرأ الظهور كطبقتين لا ككتلة واحدة.
     الصيغة المطوّلة لا المختصرة: المختصرة مع var() في خانة التوقيت تُبطل الإعلان
     كاملاً في هذا المحرّك (لا اسم حركة أصلاً). */
  /* لا حالة بداية مخفية على الأيقونة نفسها: لو لم يعمل مراقب .reveal يوماً (خطأ في
     JS أو بيئة لا تدعمه) لبقيت الأيقونات مخفية للأبد. الحركة تُضاف فوق الحالة
     الطبيعية فقط — والشفافية يتكفّل بها ظهور البطاقة كاملةً.
     وبلا fill-mode:forwards عمداً: القيمة النهائية المثبّتة تتغلّب على transform في
     :active فيُلغى ردّ فعل اللمس — والإطار الأخير هنا مطابق للحالة الطبيعية أصلاً. */
  .ql-grid .ql-tile.reveal-visible .ql-icon {
    animation-name: qlIconPop;
    animation-duration: 0.62s;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-delay: calc(var(--i, 0) * 55ms + 0.12s);
  }

  @keyframes qlIconPop {
    0%   { transform: scale(0.72) rotate(-14deg); }
    60%  { transform: scale(1.12) rotate(4deg); }
    100% { transform: none; }
  }

  /* عند اللمس: اللوحة تكبر والأيقونة تميل — ردّ فعل واضح على هدف بحجم إصبع. */
  .ql-grid .ql-tile:active .ql-icon {
    transform: scale(1.08);
    box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.26), 0 0 0 6px rgba(255, 255, 255, 0.6);
  }

  .ql-grid .ql-tile:active .ql-icon svg {
    transform: scale(1.12) rotate(-6deg);
  }

  /* شعار المجلس في البطاقة العريضة ينبض نبضة هادئة واحدة مستمرة — هو العنصر الوحيد
     ذو الحركة الدائمة في الشبكة، فلا تتحول القائمة إلى شاشة متحركة. */
  .ql-feature-emblem {
    animation-name: qlEmblemBreathe;
    animation-duration: 4.5s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }

  @keyframes qlEmblemBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.03); }
  }

  .quick-launch-title,
  .home-news-head h2 {
    font-size: 19px;
  }
}

/* قاعدة .reveal العامة لتقليل الحركة وزنها (0,1,0) — أي أن ".ql-tile.reveal"
   أعلاه (0,2,0) كان بيتغلّب عليها ويترك البطاقات مزاحة ومصغّرة بشكل دائم لمن
   فعّل تقليل الحركة. هذه القاعدة تعيد الضبط بنفس الوزن ومتأخرة عنها. */
@media (prefers-reduced-motion: reduce) {
  .ql-tile.reveal,
  .ql-tile.reveal.reveal-visible {
    transform: none;
    transition: none;
  }
}

.ibm-plex-sans-arabic-thin {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.ibm-plex-sans-arabic-extralight {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 200;
  font-style: normal;
}

.ibm-plex-sans-arabic-light {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.ibm-plex-sans-arabic-regular {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.ibm-plex-sans-arabic-medium {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 500;
  font-style: normal;
}

.ibm-plex-sans-arabic-semibold {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.ibm-plex-sans-arabic-bold {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
  font-style: normal;
}
