:root {
  --ink: #16262b;
  --muted: #69767a;
  --line: #d8d0c2;
  --paper: #fffdf8;
  --sand: #f4f0e8;
  --gold: #b58a3b;
  --green: #0f6b48;
  --deep: #12363f;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  background:
    linear-gradient(90deg, rgba(244, 231, 203, .06), rgba(244, 231, 203, .86) 50%, rgba(244, 231, 203, .96)),
    url("/assets/site-background.jpeg?v=1.5.4") left bottom / cover fixed no-repeat,
    radial-gradient(circle at 82% 4%, rgba(181, 138, 59, .18), transparent 20%),
    radial-gradient(circle at 12% 8%, rgba(181, 138, 59, .14), transparent 28%),
    linear-gradient(135deg, rgba(18, 18, 16, .06), transparent 42%),
    var(--sand);
  color: var(--ink);
  font-family: "Amiri", Tahoma, Arial, sans-serif;
  margin: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  align-items: center;
  background: rgba(10, 11, 10, .88);
  border: 1px solid rgba(181, 138, 59, .42);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  min-height: 34px;
  padding: 3px clamp(10px, 2vw, 18px);
  position: relative;
  z-index: 10;
}
.view-switch {
  align-items: center;
  border: 1px solid rgba(215, 173, 93, .34);
  border-radius: 999px;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
}
.view-switch a {
  border-radius: 999px;
  font-size: 12px;
  min-height: 28px;
  padding: 5px 10px;
}
.view-switch a.active {
  background: rgba(215, 173, 93, .2);
  color: #f7e5b8;
}
.brand {
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: inline-flex;
  gap: 8px;
  min-height: 32px;
  padding: 0;
}
.brand-title,
.compact-brand span {
  color: #d7b96a;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.brand-mark {
  align-items: center;
  background: var(--green);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}
.topbar nav {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  overflow-x: auto;
}
select option[value="female"] { background: #f6e8f4; color: #6c3f64; }
.topbar nav a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff8e8;
  font-weight: 800;
  line-height: 1.1;
  min-height: 26px;
  padding: 5px 8px;
  white-space: nowrap;
}
.topbar nav a:hover { border-color: rgba(215, 185, 106, .48); color: #d7b96a; }
.topbar nav a.login-link {
  align-items: center;
  background: #b58a3b;
  border-color: #d7b96a;
  color: #fff;
  display: inline-flex;
  gap: 7px;
  padding-inline: 11px;
}
.topbar nav a.login-link::before {
  border: 2px solid currentColor;
  border-inline-end: 0;
  border-radius: 3px 0 0 3px;
  content: "";
  height: 14px;
  width: 12px;
}

main { padding: clamp(16px, 3vw, 34px); }
.system-footer-actions {
  align-items: center;
  color: rgba(105, 87, 61, .72);
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px auto 18px;
  padding: 0;
  position: static;
}
.system-footer-actions span {
  direction: rtl;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.system-footer-actions .build-version { direction: ltr; }
.footer-motion-slot + .system-footer-actions { margin-bottom: 62px; }
.footer-motion-slot {
  background: transparent;
  bottom: 0;
  box-shadow: 0 -2px 16px rgba(0,0,0,.18);
  color: #fff4d9;
  display: flex;
  flex-direction: column;
  left: 0;
  margin: 0 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: fixed;
  right: 0;
  width: 100%;
  z-index: 2147483000;
}
.footer-ticker-bar {
  align-items: center;
  background: linear-gradient(180deg, #111416, #050606);
  border-top: 1px solid rgba(184,135,45,.72);
  display: flex;
  flex-shrink: 0;
  min-height: 36px;
  overflow: hidden;
  width: 100%;
}
.footer-ticker-appname {
  background: rgba(255,253,248,.94);
  border-top: 1px solid rgba(184,135,45,.24);
  color: #6f5933;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 3px 8px;
  text-align: center;
  user-select: none;
  width: 100%;
}
.footer-motion-slot .lazy-html-slot,
.footer-motion-slot .moving-footer-track-host {
  align-items: center;
  direction: ltr;
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.footer-motion-slot .lazy-html-slot::before,
.footer-motion-slot .lazy-html-slot::after,
.footer-motion-slot .moving-footer-track-host::before,
.footer-motion-slot .moving-footer-track-host::after {
  bottom: 0;
  content: "";
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 46px;
  z-index: 5;
}
.footer-motion-slot .lazy-html-slot::before,
.footer-motion-slot .moving-footer-track-host::before {
  background: linear-gradient(to right, #111416 20%, transparent);
  left: 0;
}
.footer-motion-slot .lazy-html-slot::after,
.footer-motion-slot .moving-footer-track-host::after {
  background: linear-gradient(to left, #111416 20%, transparent);
  right: 0;
}
.footer-motion-slot .moving-footer-track {
  align-items: center;
  animation: footer-ticker var(--ticker-duration, 42s) linear infinite;
  animation-fill-mode: backwards;
  direction: ltr;
  display: inline-flex;
  min-width: max-content;
  white-space: nowrap;
  will-change: transform;
}
.footer-motion-slot .moving-footer-track:hover { animation-play-state: paused; }
.footer-motion-slot .moving-footer-group {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  gap: 48px;
  min-width: 100vw;
  padding-inline-end: 48px;
}
.footer-motion-slot .moving-footer-item {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}
.footer-motion-slot .ad-label {
  color: #cfa45a;
  font-size: 12px;
  font-weight: 900;
  margin-inline-start: 6px;
  white-space: nowrap;
}
.footer-motion-slot .smart-footer-ad-link {
  color: #fff4d9;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}
.footer-motion-slot .smart-footer-ad-link:hover { color: #f1cb7a; }
@keyframes footer-ticker {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
.hero, .panel, .login-card, .tree-hero, .tree-board, .person-panel {
  background: rgba(255, 253, 248, .93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(22, 38, 43, .08);
}
.hero {
  background: linear-gradient(135deg, rgba(255, 253, 248, .96), rgba(255, 248, 232, .9));
  display: grid;
  min-height: 520px;
  place-items: center;
  text-align: center;
}
.landing-hero {
  align-items: stretch;
  background: linear-gradient(135deg, rgba(255, 253, 248, .96), rgba(255, 248, 232, .9));
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(280px, 430px) minmax(240px, 520px);
  justify-content: center;
  min-height: 0;
  padding: clamp(18px, 4vw, 38px);
  text-align: right;
}
.landing-hero > div {
  align-content: center;
  display: grid;
  justify-items: start;
}
.landing-hero h1 {
  font-family: "Amiri", serif;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.65;
  margin: 0 0 12px;
  max-width: 620px;
}
.landing-hero p {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 2.05;
  margin-inline: 0;
}
.landing-tree-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 6px rgba(255, 253, 248, .72), 0 16px 34px rgba(22, 38, 43, .09);
  justify-self: center;
  margin: 0;
  max-height: clamp(240px, 48vh, 480px);
  max-width: min(100%, 520px);
  overflow: hidden;
  width: 100%;
}

.site-landing {
  background:
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, .72), transparent 28%),
    radial-gradient(ellipse at 8% 80%, rgba(94, 65, 31, .34), transparent 28%),
    linear-gradient(rgba(247, 240, 223, .93), rgba(247, 240, 223, .9)),
    repeating-linear-gradient(45deg, rgba(181, 138, 59, .08) 0 2px, transparent 2px 22px),
    #f7f0df;
  border: 2px solid rgba(181, 138, 59, .72);
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(22, 38, 43, .14);
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  margin-inline: auto;
  max-width: 1280px;
  min-height: min(760px, calc(100vh - 92px));
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
  position: relative;
  text-align: center;
}
.site-landing::before {
  background:
    linear-gradient(90deg, transparent, rgba(18, 18, 16, .92) 36% 64%, transparent),
    linear-gradient(180deg, #191815, #0d0d0c);
  border: 2px solid rgba(181, 138, 59, .72);
  border-radius: 18px;
  content: "";
  height: 78px;
  inset: 18px 18px auto;
  position: absolute;
}
.site-landing::after {
  color: rgba(181, 138, 59, .13);
  content: "✦";
  font-size: clamp(90px, 13vw, 180px);
  position: absolute;
  right: 42px;
  top: 82px;
}
.landing-copy {
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 1;
}
.landing-copy h1 {
  color: #17110a;
  font-size: clamp(56px, 9vw, 118px);
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 4px 0 rgba(181, 138, 59, .18);
}
.lineage-text {
  background: linear-gradient(180deg, #191815, #0d0d0c);
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: #fff4d8 !important;
  font-size: clamp(18px, 2.2vw, 28px) !important;
  font-weight: 900;
  line-height: 1.4 !important;
  margin: 16px auto !important;
  padding: 10px 28px;
  width: fit-content;
}
.landing-quick-links {
  background: linear-gradient(180deg, #191815, #0d0d0c);
  border: 2px solid var(--gold);
  border-radius: 24px;
  box-shadow: 0 -10px 26px rgba(0, 0, 0, .16);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: auto;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.landing-quick-links a {
  border-inline-start: 1px solid rgba(215, 185, 106, .34);
  color: #fff6de;
  display: grid;
  gap: 8px;
  min-height: 104px;
  place-items: center;
  padding: 14px 8px;
}
.landing-quick-links a:first-child { border-inline-start: 0; }
.landing-quick-links span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}
.landing-quick-links strong { font-size: clamp(15px, 1.5vw, 20px); }
.site-landing .landing-tree-preview {
  justify-self: center;
  max-height: clamp(150px, 24vh, 250px);
  max-width: min(100%, 520px);
}
.site-landing .landing-tree-preview img {
  max-height: clamp(150px, 24vh, 250px);
}
.landing-tree-preview img {
  animation: tree-soft-presence 14s ease-in-out infinite alternate;
  display: block;
  height: auto;
  max-height: clamp(240px, 48vh, 480px);
  object-fit: contain;
  width: 100%;
}
@keyframes tree-soft-presence {
  from { transform: scale(.985); }
  to { transform: scale(1.015); }
}
.hero h1 { font-size: clamp(34px, 6vw, 74px); line-height: 1.15; margin: 0 auto 14px; max-width: 850px; }
.hero p { color: var(--muted); line-height: 1.9; margin: 0 auto 22px; max-width: 680px; }
.eyebrow { color: var(--gold); font-size: 13px; font-weight: 900; margin: 0 0 8px; }
.button, button {
  background: var(--deep);
  border: 1px solid var(--deep);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
}
button:hover, .button:hover { filter: brightness(1.08); }
.danger-button {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
}

.login-shell { display: grid; min-height: calc(100vh - 120px); place-items: center; }
.login-card { max-width: 430px; padding: 26px; width: 100%; }
.login-card h1 { margin: 0 0 18px; }
label { color: var(--muted); display: grid; font-size: 13px; font-weight: 900; gap: 7px; margin: 12px 0 6px; }
input, select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  padding: 8px 12px;
  width: 100%;
}
.phone-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 170px) minmax(180px, 1fr);
}
.phone-row label { margin-bottom: 0; }
.phone-row select, .phone-row input { min-height: 44px; }
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}
.hint { color: var(--muted); font-size: 12px; line-height: 1.8; }
.activation-resend-card { margin-top: 18px; }
.activation-resend-card summary { color: var(--primary); cursor: pointer; font-weight: 700; list-style: none; }
.activation-resend-card summary::-webkit-details-marker { display: none; }
.activation-resend-form { margin-top: 14px; }
.alert {
  background: #fff3d7;
  border: 1px solid #e8c982;
  border-radius: 7px;
  color: #6f4d0f;
  margin: 12px 0;
  padding: 10px 12px;
}
.success { background: #e5f6ed; border-color: #9fd6b8; color: #0f5c3d; }

.admin-panel, .panel { margin-inline: auto; max-width: 1180px; padding: 24px; }
.section-header {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1180px;
}
.section-header h1 { font-size: clamp(28px, 4vw, 48px); margin: 0; }
.service-group-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.9;
  margin: 8px 0 0;
  max-width: 760px;
}
.service-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto 18px;
  max-width: 1180px;
}
.service-grid a, .community-panel, .content-card, .community-compose {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(22, 38, 43, .07);
}
.service-grid a {
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 18px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.service-grid a:hover, .content-card:hover {
  box-shadow: 0 18px 42px rgba(22, 38, 43, .12);
  transform: translateY(-2px);
}
.service-grid span, .content-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}
.service-grid h3, .content-card h2, .community-panel h2 { margin: 0; }
.service-grid p, .content-card p, .content-detail p { color: var(--muted); line-height: 1.85; margin: 0; }
.service-group-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.service-shortcuts {
  margin-bottom: 22px;
}
.service-group-grid a small {
  color: var(--gold-dark);
  font-weight: 900;
}
.community-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
}
.community-panel { display: grid; gap: 10px; padding: 18px; }
.content-list {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 980px;
}
.content-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}
.compact-list { display: grid; gap: 8px; }
.compact-list a {
  align-items: center;
  background: #f6efe3;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}
.content-detail { margin: 0 auto 16px; }
.community-compose {
  margin: 0 auto 16px;
  max-width: 760px;
  padding: 18px;
}
.empty {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.stats span {
  background: #f6efe3;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 140px;
  padding: 12px 16px;
}
.stats strong { display: block; font-size: 28px; }
.soft-separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.role-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.nav-bell strong {
  background: #b58a3b;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  min-width: 22px;
  justify-content: center;
  padding: 2px 7px;
}
.permission-grid, .request-grid, .messages-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.request-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.permission-grid article, .request-card, .admin-user-card, .message-side, .message-main {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.permission-grid h3, .admin-section h2, .request-column h2, .message-side h2 { margin: 0 0 8px; }
.permission-grid p { color: var(--muted); line-height: 1.8; margin: 0; }
.admin-table-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-table-pair article {
  min-width: 0;
}
.admin-table-pair h3 {
  margin: 0 0 10px;
}
.admin-table-scroll {
  background: rgba(255, 253, 248, .92);
  border: 1px solid rgba(188, 153, 117, .28);
  border-radius: 12px;
  overflow-x: auto;
}
.admin-data-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}
.admin-data-table th,
.admin-data-table td {
  border-bottom: 1px solid rgba(188, 153, 117, .18);
  font-size: 13px;
  padding: 10px 12px;
  text-align: right;
  vertical-align: top;
}
.admin-data-table th {
  background: rgba(7, 63, 70, .08);
  color: #073f46;
  font-weight: 900;
}
.admin-data-table tr:last-child td {
  border-bottom: 0;
}
.permission-badge,
.login-method-badge {
  background: rgba(184, 138, 58, .14);
  border: 1px solid rgba(184, 138, 58, .26);
  border-radius: 999px;
  color: #6d4d13;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
  padding: 4px 9px;
  white-space: nowrap;
}
.admin-table-controls,
.admin-table-pager {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 12px 0;
}
.admin-table-controls label {
  align-items: center;
  display: inline-flex;
  flex-direction: row;
  gap: 8px;
  margin: 0;
}
.admin-table-controls select {
  min-height: 38px;
  min-width: 92px;
  width: auto;
}
.admin-table-controls [data-table-info],
.admin-table-pager [data-table-page-info] {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.admin-table-pager {
  justify-content: center;
}
.admin-data-table tr[hidden] {
  display: none !important;
}
.compact-button {
  min-height: 34px;
  padding: 6px 12px;
  width: auto;
}
.inline-admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-admin-form input {
  min-width: 130px;
  max-width: 170px;
  padding: 8px 10px;
}
.admin-reset-password-form textarea {
  min-height: 100px;
}
.login-method-status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 14px;
}
.checkbox-wrapper {
  cursor: pointer;
  display: inline-flex;
  margin: 0;
}
.checkbox-input {
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  position: absolute;
}
.checkbox-tile {
  align-items: center;
  background: rgba(255, 253, 248, .92);
  border: 1px solid rgba(188, 153, 117, .34);
  border-radius: 12px;
  color: #073f46;
  display: inline-flex;
  gap: 10px;
  min-height: 48px;
  padding: 9px 16px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.checkbox-icon {
  align-items: center;
  background: rgba(184, 138, 58, .13);
  border-radius: 999px;
  color: #8a641d;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.checkbox-icon .fa {
  font-style: normal;
}
.checkbox-icon .fa-eye::before {
  content: "◉";
}
.checkbox-icon .fa-eye-slash::before {
  content: "○";
}
.checkbox-label {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
.checkbox-input:checked + .checkbox-tile {
  background: #073f46;
  border-color: #b88a3a;
  box-shadow: 0 10px 24px rgba(7, 63, 70, .16);
  color: #fff8e8;
}
.checkbox-input:checked + .checkbox-tile .checkbox-icon {
  background: rgba(255, 248, 232, .16);
  color: #f1c76e;
}
.admin-assignment-form, .admin-users-list {
  display: grid;
  gap: 10px;
}
.admin-user-search {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  max-width: 520px;
}
.admin-user-search input { min-height: 48px; }
.admin-assignment-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-assignment-form button { align-self: end; }
.permission-search-form .wide-field {
  grid-column: 1 / -1;
}
.permission-search-form .eligible-user-select {
  min-height: 170px;
}
.admin-user-card {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-user-card > div { display: grid; gap: 4px; }
.admin-user-card small { color: var(--muted); }
.floating-person-card {
  grid-template-columns: 1fr;
}
.floating-person-title {
  align-items: start;
  display: flex !important;
  gap: 10px;
}
.floating-action-icon {
  align-items: center;
  background: var(--gold);
  border-radius: 999px;
  color: #111416;
  display: inline-flex;
  flex: 0 0 30px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  line-height: 1;
  width: 30px;
}
.floating-issue {
  background: rgba(127, 29, 29, .07);
  border: 1px solid rgba(127, 29, 29, .18);
  border-radius: 8px;
  color: #7f1d1d;
  line-height: 1.8;
  margin: 0;
  padding: 8px 10px;
}
.floating-suggestions {
  display: grid;
  gap: 8px;
}
.floating-suggestions form,
.floating-transfer form {
  margin: 0;
}
.parent-code-preview {
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
  padding: 4px 0;
}
.parent-code-preview.ok {
  color: #166534;
}
.parent-code-preview.error {
  color: #7f1d1d;
}
.parent-code-preview.loading {
  color: var(--deep);
}
.checkline {
  align-items: center;
  display: flex;
  gap: 8px;
}
.checkline input { min-height: auto; width: auto; }
[data-student-fields], [data-work-fields] {
  display: grid;
  gap: 8px;
}
[data-student-fields][hidden], [data-work-fields][hidden] { display: none !important; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.back-button-small {
  background: #7f1d1d !important;
  border-color: #7f1d1d !important;
  border-radius: 999px !important;
  color: #fff !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  margin-block: 10px 0;
  min-height: 0 !important;
  padding: 6px 12px !important;
  width: fit-content;
}
.back-button-small:hover {
  background: #991b1b !important;
  color: #fff !important;
}
.request-bell {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--deep);
  font-weight: 900;
  padding: 10px 14px;
}
.request-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.request-card small, .request-card span { color: var(--muted); }
.wide-panel { max-width: 1180px; }
.messages-layout { align-items: start; max-width: 1180px; margin-inline: auto; }
.message-side, .message-main { display: grid; gap: 12px; }
.message-filter-form { margin: 0; }
.message-side select { margin-bottom: 8px; }
.mini-request { display: grid; gap: 8px; }
.friend-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-tabs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  padding: 8px 12px;
}
.friend-tabs a.active { background: var(--deep); color: #fff; }

.calendar-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
}
.calendar-form {
  align-self: start;
}
.calendar-list {
  display: grid;
  gap: 12px;
}
.calendar-card {
  background: rgba(255,253,248,.94);
  border: 1px solid rgba(181, 138, 59, .32);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(22, 38, 43, .08);
  padding: 16px;
}
.calendar-card time {
  color: var(--gold);
  direction: ltr;
  font-weight: 900;
}
.calendar-card h2 { margin: 6px 0; }
.calendar-card span {
  color: var(--muted);
  font-weight: 900;
}
.status-pill {
  background: rgba(18,54,63,.08);
  border: 1px solid rgba(184,135,45,.25);
  border-radius: 999px;
  color: #12363f;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-self: start;
  line-height: 1.5;
  padding: 4px 9px;
}
.inline-form { margin: 0; }
.inline-form button {
  min-height: 34px;
  padding: 7px 12px;
}
.message-thread {
  background: #f6efe3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}
.message-thread p {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.8;
  margin: 0;
  padding: 10px;
}
.message-thread p.mine { background: #e5f6ed; border-color: #9fd6b8; }
.message-thread strong { display: block; font-size: 12px; color: var(--gold); }
.message-compose { display: grid; gap: 8px; }

.directory-filter {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.directory-filter label { margin: 0; }
.directory-filter button {
  border-radius: 7px;
  height: 46px;
  min-height: 46px;
  padding-block: 0;
  width: 100%;
}
.directory-grid, .library-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-inline: auto;
  max-width: 1180px;
}
.directory-card, .library-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(22, 38, 43, .07);
  display: grid;
  gap: 10px;
  padding: 16px;
}
.directory-card h2, .library-card h2 { margin: 0; }
.directory-card summary {
  color: var(--deep);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  list-style: none;
}
.directory-card summary::-webkit-details-marker { display: none; }
.directory-card summary::before {
  color: var(--gold);
  content: "+";
  display: inline-block;
  font-weight: 900;
  margin-inline-end: 8px;
}
.directory-card[open] summary::before { content: "−"; }
.directory-card.female-card {
  background: linear-gradient(180deg, rgba(255,250,253,.96), rgba(250,238,248,.9));
  border-color: rgba(143, 83, 132, .45);
}
.directory-card.female-card summary::before { color: #8f5384; }
.family-directory-filter {
  grid-template-columns: minmax(0, 1fr) 180px;
  max-width: 760px;
}
.family-directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-width: 982px;
}
.family-directory-card {
  min-height: 190px;
}
.family-directory-card.is-alive {
  border-color: rgba(27, 111, 94, .38);
  box-shadow: 0 12px 30px rgba(27, 111, 94, .10), 0 0 0 4px rgba(27, 111, 94, .08);
}
.family-directory-card.is-deceased {
  background: linear-gradient(180deg, rgba(250,247,240,.92), rgba(225,220,211,.72));
  border-color: rgba(72, 72, 72, .28);
  filter: saturate(.78);
}
.family-directory-card.is-deceased p {
  background: #1f2426;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  justify-self: start;
  padding: 2px 10px;
}
.directory-card p, .library-card p { color: var(--muted); line-height: 1.8; margin: 0; }
.directory-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}
.directory-card dl > div {
  border-top: 1px solid rgba(216, 208, 194, .7);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-top: 7px;
}
.directory-card dt { color: var(--muted); font-weight: 900; }
.directory-card dd { margin: 0; text-align: left; }
.library-card {
  min-height: 240px;
}
.library-section-heading {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 22px auto 10px;
  max-width: 1180px;
}
.library-section-heading h2 {
  color: var(--deep);
  font-size: clamp(24px, 3vw, 34px);
  margin: 0;
}
.library-section-heading p {
  color: var(--muted);
  margin: 0;
}
.photo-library-card .library-cover {
  aspect-ratio: 4 / 3;
  width: 100%;
}
.library-cover {
  aspect-ratio: 3 / 4;
  background: #f7f0df;
  border: 1px solid rgba(181, 138, 59, .45);
  border-radius: 7px;
  box-shadow: 0 12px 22px rgba(22, 38, 43, .13);
  object-fit: cover;
  width: min(100%, 220px);
}
.library-cover-pdf {
  min-height: 260px;
  pointer-events: none;
}
.library-cover-placeholder {
  align-items: center;
  background: linear-gradient(160deg, #171717, #2d2417);
  color: #d6a95b;
  display: flex;
  justify-content: center;
}
.library-cover-placeholder svg {
  height: 82px;
  width: 82px;
}
.library-card span { color: var(--gold); font-size: 12px; font-weight: 900; }
.book-reader {
  display: grid;
  gap: 14px;
  margin-inline: auto;
  max-width: none;
  min-height: calc(100vh - 92px);
  width: 100%;
}
.book-reader-head, .book-controls {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}
.book-reader-head h1 { margin: 0; }
.book-reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.book-controls span {
  color: var(--deep);
  font-weight: 900;
  min-width: 130px;
  text-align: center;
}
.book-stage {
  background:
    linear-gradient(90deg, rgba(18, 38, 43, .06), transparent 10% 90%, rgba(18, 38, 43, .06)),
    #f8f1df;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 10px rgba(255, 253, 248, .55), 0 18px 44px rgba(22, 38, 43, .12);
  display: grid;
  min-height: calc(100vh - 230px);
  overflow: auto;
  padding: clamp(10px, 2vw, 22px);
  place-items: start center;
}
.book-object,
.book-stage iframe {
  background: #fff;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(22, 38, 43, .18);
  height: calc(100vh - 250px);
  max-width: 100%;
  min-height: 640px;
  width: min(100%, 1120px);
}
.reader-mode {
  background: #100d09;
  overflow: hidden;
}
.reader-mode .topbar { display: none; }
.reader-mode main { padding: 0; }
.reader-mode .book-reader {
  background:
    radial-gradient(circle at 50% 0, rgba(181, 138, 59, .18), transparent 30%),
    #100d09;
  color: #fff7e4;
  height: 100vh;
  margin: 0;
  max-width: none;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100vw;
}
.reader-mode .book-reader-head {
  background: linear-gradient(180deg, rgba(17,20,22,.92), rgba(5,6,6,.82));
  border-color: rgba(181, 138, 59, .55);
  border-radius: 0 0 14px 14px;
  inset: 0 0 auto;
  padding: 8px 14px;
  position: absolute;
  z-index: 5;
}
.reader-mode .book-reader-head h1 {
  color: #fff7e4;
  font-size: clamp(17px, 2vw, 25px);
}
.reader-mode .book-reader-head .eyebrow { margin: 0; }
.reader-mode .book-stage {
  background: #17120c;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding: 56px 70px 22px;
  place-items: stretch;
}
.reader-mode .book-object,
.reader-mode .book-stage iframe {
  border-radius: 0;
  box-shadow: none;
  height: calc(100vh - 78px);
  max-width: none;
  min-height: 0;
  width: 100%;
}
.reader-mode .book-controls {
  background: transparent;
  border: 0;
  border-radius: 0;
  inset: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}
.reader-mode .book-controls span {
  background: rgba(17,20,22,.78);
  border: 1px solid rgba(181, 138, 59, .46);
  border-radius: 999px;
  color: #fff7e4;
  left: 50%;
  min-width: 120px;
  padding: 8px 14px;
  pointer-events: auto;
  position: absolute;
  top: 68px;
  transform: translateX(-50%);
}
.reader-mode .reader-side {
  align-items: center;
  background: rgba(17,20,22,.78);
  border-color: rgba(181, 138, 59, .62);
  border-radius: 999px;
  color: #fff7e4;
  height: 54px;
  min-height: 54px;
  padding: 0 16px;
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.reader-mode .reader-prev { right: 12px; }
.reader-mode .reader-next { left: 12px; }
.reader-mode .reader-bookmark {
  background: rgba(17,20,22,.86);
  border-color: rgba(181, 138, 59, .62);
  border-radius: 999px;
  bottom: 16px;
  color: #fff7e4;
  left: 16px;
  min-height: 42px;
  pointer-events: auto;
  position: absolute;
}
.reader-mode [data-reader-status] {
  background: rgba(17,20,22,.76);
  border: 1px solid rgba(181, 138, 59, .44);
  border-radius: 999px;
  bottom: 16px;
  color: #f5dfad;
  margin: 0;
  max-width: min(520px, 55vw);
  padding: 8px 14px;
  position: absolute;
  right: 16px;
  z-index: 7;
}

.tree-page { display: grid; gap: 14px; }
.tree-hero {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  padding: 20px;
}
.tree-hero h1 { font-size: clamp(28px, 4vw, 46px); margin: 0 0 8px; }
.tree-hero p { color: var(--muted); margin: 0; }
.tree-search-panel {
  align-items: end;
  background: rgba(255, 253, 248, .88);
  border: 1px solid rgba(170, 128, 57, .26);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 360px) 1fr;
  padding: 12px;
}
.tree-search-panel label {
  color: var(--deep);
  display: grid;
  font-weight: 900;
  gap: 6px;
}
.tree-search-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-width: 982px;
}
.tree-search-results button {
  background: #fffaf0;
  border: 1px solid rgba(170, 128, 57, .32);
  border-radius: 8px;
  color: var(--deep);
  display: grid;
  min-height: 62px;
  min-width: 0;
  padding: 8px 11px;
  text-align: start;
  width: 100%;
}
.tree-search-results .tree-search-person {
  position: relative;
}
.tree-search-results .tree-search-person::after {
  border-radius: inherit;
  content: "";
  inset: -4px;
  pointer-events: none;
  position: absolute;
}
.tree-search-results .tree-search-person.is-alive::after {
  box-shadow: 0 0 0 3px rgba(102, 184, 158, .20);
}
.tree-search-results .tree-search-person.is-deceased {
  background: #ede8df;
  color: #172326;
}
.tree-search-results .tree-search-person.is-deceased::after {
  box-shadow: 0 0 0 3px rgba(25, 28, 30, .20);
}
.tree-search-results small {
  color: var(--muted);
  font-weight: 800;
}
.toolbar {
  background: #f6efe3;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px;
}
.tree-board { overflow: hidden; }
.tree-canvas {
  background:
    linear-gradient(rgba(18, 54, 63, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 54, 63, .03) 1px, transparent 1px),
    #fffdf8;
  background-size: 28px 28px;
  direction: ltr;
  min-height: 650px;
  overflow: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.tree-loading {
  color: var(--muted);
  display: grid;
  font-weight: 900;
  min-height: 420px;
  place-items: center;
}
.tree-canvas svg { display: block; min-width: 100%; }
.link {
  fill: none;
  stroke: #9fb5bd;
  stroke-linecap: round;
  stroke-width: 2;
}
.node-card {
  filter: drop-shadow(0 7px 12px rgba(18, 54, 63, .16));
}
.node-card.active {
  filter: drop-shadow(0 0 0 rgba(0,0,0,0)) drop-shadow(0 0 16px rgba(184,135,45,.7));
}
.node-card.active rect {
  stroke: #d7ad5d;
  stroke-width: 2.4;
}
.node-card rect {
  fill: #12363f;
  stroke: #09272f;
  stroke-width: 1.2;
}
.node-card text {
  direction: rtl;
  fill: #fff;
  font-size: 13px;
  font-weight: 900;
}
.node-card .sub { fill: #cddadd; font-size: 10px; font-weight: 700; }
.node-card .status-label {
  fill: #fff;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 6.2px;
  font-weight: 900;
}
.node-card.deceased rect {
  fill: #6f807c;
  opacity: .76;
  stroke: #4d625e;
}
.node-card:not(.deceased) rect {
  stroke: rgba(225, 213, 174, .92);
}
.node-card.deceased .status-badge { fill: #111; stroke: rgba(255,255,255,.34); stroke-width: .5; }
.node-card.female rect { fill: #6c3f64; stroke: #4a2544; }
.node-card.pending rect {
  fill: #2d4f42;
  stroke: #b58a3b;
  stroke-dasharray: 4 3;
}
.node-card .pending-badge { fill: #fff4cf; stroke: #b58a3b; stroke-width: .8; }
.node-card .pending-label { fill: #6f4c0e; font-size: 8.5px; font-weight: 900; }
.node-card .family-jump circle {
  fill: #111416;
  stroke: #d7ad5d;
  stroke-width: 1;
}
.node-card .family-jump text {
  fill: #f7e5b8;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 7px;
  font-weight: 900;
}
.node-card .family-jump:hover circle {
  fill: #1f2c2d;
}
.node-card .plus circle { fill: #fffdf8; stroke: #b58a3b; stroke-width: 1.5; }
.node-card .plus text { fill: #12363f; font-size: 18px; }
.person-panel {
  bottom: 18px;
  display: grid;
  gap: 8px;
  left: 18px;
  max-width: 360px;
  padding: 18px;
  position: fixed;
  z-index: 20;
}
body.adding-child-modal .person-panel { display: none !important; }
.person-panel[hidden] { display: none; }
.person-panel h2 { margin: 0; }
.person-panel dl { display: grid; gap: 7px; margin: 0; }
.person-panel dl > div { display: flex; justify-content: space-between; gap: 12px; }
.person-panel dt { color: var(--muted); font-weight: 900; }
.person-panel dd { margin: 0; text-align: left; }
.tree-role-form {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 12px;
}
.tree-role-form h3 {
  color: var(--deep);
  font-size: 17px;
  margin: 0;
}
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.view-switch { display: none !important; }
.affinity-summary {
  background: rgba(181, 138, 59, .10);
  border: 1px solid rgba(181, 138, 59, .26);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 10px;
}
.affinity-summary h3 {
  color: var(--deep);
  font-size: 16px;
  margin: 0;
}
.affinity-summary p {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 0;
}
.affinity-summary strong { color: #8a631f; }
.affinity-request-form [data-affinity-outside],
.affinity-request-form [data-affinity-khunaini] {
  display: grid;
  gap: 8px;
}
.affinity-request-form [hidden] { display: none !important; }
.affinity-family-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}
.affinity-family-list article {
  align-items: center;
  background: #fffaf1;
  border: 1px solid rgba(181, 138, 59, .28);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}
.affinity-family-list strong { color: var(--deep); }
.affinity-family-list span {
  background: rgba(18, 54, 63, .10);
  border-radius: 999px;
  color: var(--deep);
  font-weight: 900;
  min-width: 34px;
  padding: 4px 10px;
  text-align: center;
}
.profile-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
}
.profile-form label { margin: 0; }
.profile-form input, .profile-form select { min-height: 38px; }
.profile-form button { width: 100%; }
.hijri-calendar-dialog {
  background: #fffaf1;
  border: 1px solid rgba(184, 138, 58, .35);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(9, 24, 28, .22);
  color: var(--deep);
  direction: rtl;
  max-width: calc(100vw - 24px);
  padding: 14px;
  position: absolute;
  width: 540px;
  z-index: 100000;
}
.dual-calendar-top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dual-calendar-reset {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 0;
}
.dual-calendar-switch {
  align-items: center;
  color: var(--deep);
  display: inline-flex;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
}
.dual-calendar-switch input {
  accent-color: var(--deep);
  block-size: 24px;
  inline-size: 44px;
}
.hijri-calendar-header {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  margin-bottom: 10px;
}
.dual-calendar-selects {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hijri-calendar-select-label {
  color: #6a5634;
  display: grid;
  font-size: 11px;
  font-weight: 900;
  gap: 4px;
}
.hijri-calendar-select {
  background: #fffaf1;
  border: 1px solid rgba(184, 138, 58, .35);
  border-radius: 12px;
  color: var(--deep);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 6px 10px;
}
.hijri-calendar-title {
  color: var(--deep);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}
.hijri-calendar-nav {
  border-radius: 999px;
  inline-size: 48px;
  min-height: 48px;
  padding: 0;
}
.hijri-calendar-weekdays,
.hijri-calendar-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.hijri-calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.hijri-calendar-empty { min-height: 34px; }
.hijri-calendar-day {
  background: #fff;
  border: 1px solid rgba(216, 208, 194, .8);
  border-radius: 12px;
  color: var(--deep);
  font-weight: 900;
  min-height: 52px;
  padding: 0;
}
.hijri-calendar-day:hover,
.hijri-calendar-day.is-today {
  background: var(--deep);
  border-color: var(--deep);
  color: #f2c76b;
}
.hijri-calendar-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding-top: 10px;
  text-align: center;
}
.notification-user-picker {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(184, 138, 58, .18);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 14px;
}
.notification-user-selected {
  background: rgba(7, 63, 70, .06);
  border-radius: 12px;
  color: var(--deep);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
}
.notification-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.notification-user-results {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.notification-user-result {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(184, 138, 58, .22);
  border-radius: 14px;
  color: var(--deep);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr;
  padding: 12px 14px;
  text-align: right;
  width: 100%;
}
.notification-user-result-check {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}
.notification-user-result-check input {
  accent-color: var(--gold);
  cursor: pointer;
  height: 18px;
  margin: 0;
  width: 18px;
}
.notification-user-result-body {
  display: grid;
  gap: 4px;
}
.notification-user-result strong {
  font-size: 15px;
}
.notification-user-result small {
  color: var(--muted);
}
.notification-user-result:hover {
  border-color: rgba(7, 63, 70, .45);
  transform: translateY(-1px);
}
.notification-user-result:has(input:checked) {
  background: rgba(7, 63, 70, .06);
  border-color: rgba(7, 63, 70, .55);
}
.notification-user-result.is-chosen {
  background: rgba(7, 63, 70, .06);
  border-color: rgba(7, 63, 70, .55);
}
.child-request-form h3 {
  color: var(--deep);
  font-size: 18px;
  margin: 0;
}
.modal-open { overflow: hidden; }
.kh-modal-backdrop {
  align-items: center;
  background: rgba(13, 12, 10, .58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 2147482500;
}
.kh-modal {
  background:
    linear-gradient(180deg, rgba(255,250,241,.98), rgba(247,235,213,.96)),
    radial-gradient(circle at 12% 12%, rgba(181,138,59,.16), transparent 28%);
  border: 1px solid rgba(181, 138, 59, .42);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0,0,0,.34);
  display: grid;
  max-height: min(90vh, 760px);
  max-width: min(94vw, 660px);
  overflow: hidden;
  width: 100%;
}
.kh-modal header {
  align-items: center;
  background: #111416;
  border-bottom: 1px solid rgba(215,173,93,.42);
  color: #f7e5b8;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}
.kh-modal header h2 {
  color: inherit;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 24px;
  margin: 0;
}
.kh-modal [data-modal-close] {
  border-radius: 999px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}
.kh-modal-body {
  max-height: calc(90vh - 68px);
  overflow: auto;
  padding: 16px;
}
.kh-modal-body .profile-form {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.contact-page { max-width: 1180px; }
.contact-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}
.contact-card {
  background: linear-gradient(180deg, rgba(255,250,241,.98), rgba(249,235,210,.94));
  border: 1px solid rgba(181, 138, 59, .34);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(38,25,10,.11);
  display: grid;
  gap: 8px;
  padding: 16px;
}
.contact-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}
.contact-card h2 { margin: 0; }
.contact-card a,
.contact-card p[dir="ltr"] {
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--deep);
  font-weight: 900;
  margin: 0;
  padding: 10px 12px;
  text-align: left;
}
.contact-card.contact-empty {
  border-style: dashed;
  box-shadow: none;
  opacity: .9;
}
.contact-card.contact-empty p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}
.inline-delete { margin: 0; }
.inline-delete button { min-height: 34px; padding: 6px 10px; width: auto; }
.contact-form {
  border-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.contact-form button,
.contact-form .checkline { grid-column: 1 / -1; }

.bio-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.bio-card {
  background: rgba(255,250,241,.96);
  border: 1px solid rgba(184,135,45,.26);
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(32,22,10,.12);
  display: grid;
  gap: 16px;
  grid-template-columns: 94px 1fr;
  overflow: hidden;
  padding: 18px;
}
.bio-card img {
  aspect-ratio: 1;
  border-radius: 14px;
  height: 94px;
  object-fit: cover;
  width: 94px;
}
.bio-card span,
.bio-card small {
  color: #9a6c20;
  font-weight: 800;
}
.bio-card h2 {
  margin: 4px 0 8px;
}
.bio-card p {
  color: #514737;
  margin: 0 0 10px;
}
.bio-open-button { margin-top: 8px; width: auto; }
.bio-modal-content {
  display: grid;
  gap: 10px;
  line-height: 1.9;
}
.bio-modal-content img {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  justify-self: center;
  max-height: 220px;
  object-fit: cover;
  width: min(160px, 45vw);
}
.bio-modal-content span,
.bio-modal-content small { color: #9a6c20; font-weight: 900; }
.bio-modal-content h2 { margin: 0; text-align: center; }
.bio-modal-content p { color: #40372b; margin: 0; white-space: normal; }

.tree-pdf-reader object,
.tree-pdf-reader iframe {
  background: #f7efe1;
  border: 0;
  display: block;
  height: calc(100vh - 78px);
  width: 100%;
}

.id-card-page { display: grid; gap: 18px; justify-items: center; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.identity-card {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(90deg, transparent 0 10%, #12272f 10% 23%, transparent 23%),
    radial-gradient(circle at 72% 88%, rgba(112, 82, 36, .18), transparent 18%),
    linear-gradient(135deg, #fffaf0, #f6eedc 55%, #fffdf8);
  border: 8px solid #111;
  border-radius: clamp(18px, 2vw, 34px);
  box-shadow: 0 28px 70px rgba(18, 38, 43, .22);
  color: #1a1207;
  display: grid;
  grid-template-columns: 31% 1fr;
  max-width: 1120px;
  overflow: hidden;
  position: relative;
  width: min(100%, 1120px);
}
.card-border {
  border: 2px solid #b58a3b;
  border-radius: 24px;
  inset: 18px;
  pointer-events: none;
  position: absolute;
}
.card-ribbon {
  background:
    linear-gradient(90deg, #b58a3b 0 4px, transparent 4px 14px, #b58a3b 14px 18px),
    #14262e;
  bottom: 9%;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 172, .38);
  position: absolute;
  right: 12%;
  top: 0;
  width: 14%;
}
.card-ribbon::after {
  border-inline: 50px solid transparent;
  border-top: 72px solid #14262e;
  bottom: -72px;
  content: "";
  position: absolute;
  right: calc(50% - 50px);
}
.card-corner {
  border-color: #b58a3b;
  height: 78px;
  opacity: .9;
  position: absolute;
  width: 78px;
}
.card-corner-tr { border-right: 3px solid; border-top: 3px solid; left: 26px; top: 26px; }
.card-corner-bl { border-bottom: 3px solid; border-left: 3px solid; bottom: 26px; right: 26px; }
.identity-logo {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 20% 8% 10%;
  position: relative;
  z-index: 2;
}
.identity-logo img {
  background: #fffdf8;
  border: 7px solid #f6edda;
  border-radius: 50%;
  box-shadow: 0 14px 35px rgba(26, 18, 7, .25);
  max-width: 94%;
}
.identity-content {
  align-content: center;
  display: grid;
  gap: clamp(10px, 2vw, 24px);
  justify-items: center;
  padding: 7% 7% 8% 8%;
  position: relative;
  text-align: center;
  z-index: 2;
}
.card-title {
  background: linear-gradient(180deg, #1a252b, #0d171c);
  border: 2px solid #b58a3b;
  border-radius: 14px;
  box-shadow: 0 8px 0 rgba(181, 138, 59, .24);
  color: #e5bf72;
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 900;
  line-height: 1;
  padding: .25em 1.3em .36em;
}
.ornament { color: #9b722d; font-weight: 900; }
.identity-content h2 {
  font-size: clamp(24px, 4.3vw, 58px);
  line-height: 1.45;
  margin: 0;
}
.branch-name {
  border: 2px solid #b58a3b;
  border-inline-width: 4px;
  color: #23170a;
  font-size: clamp(19px, 3.2vw, 42px);
  font-weight: 900;
  line-height: 1.6;
  padding: .26em 1.8em;
  width: min(92%, 760px);
}
.residence {
  color: #5b4b32;
  font-size: clamp(14px, 2vw, 24px);
  font-weight: 800;
}
.lineage {
  color: #23170a;
  font-size: clamp(18px, 2.8vw, 36px);
  font-weight: 900;
}
.palm { color: #89714c; font-size: clamp(46px, 7vw, 90px); line-height: 1; }

.identity-card-template {
  border-radius: clamp(16px, 2vw, 32px);
  box-shadow: 0 28px 70px rgba(18, 38, 43, .22);
  max-width: 1120px;
  overflow: hidden;
  position: relative;
  width: min(100%, 1120px);
}
.identity-card-template img {
  display: block;
  width: 100%;
}
.card-template-text {
  align-items: center;
  color: #171006;
  direction: rtl;
  display: flex;
  font-family: Tahoma, Arial, sans-serif;
  font-weight: 900;
  justify-content: center;
  line-height: 1.22;
  overflow: hidden;
  padding-inline: 10px;
  position: absolute;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 1px rgba(112, 82, 36, .16);
}
.card-template-name {
  font-size: clamp(16px, 2.55vw, 38px);
  height: 10%;
  left: 35%;
  right: 4%;
  top: 30.2%;
}
.card-template-branch {
  font-size: clamp(14px, 1.95vw, 30px);
  height: 7%;
  left: 37%;
  right: 7%;
  top: 47.6%;
}

.community-home {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0 auto;
  max-width: 1440px;
  min-height: calc(100vh - 118px);
  overflow: hidden;
  padding: clamp(18px, 2.8vw, 42px) clamp(10px, 2.2vw, 28px) 70px;
  position: relative;
}
.community-home::before {
  content: "";
  display: none;
}
.home-editable-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}
.community-home .home-zone-hero {
  left: var(--x, 50%);
  pointer-events: auto;
  position: absolute;
  top: var(--y, 36%);
  transform: translate(-50%, -50%);
  width: min(var(--w, 42%), 92%);
  z-index: 2;
}
.community-home .home-block-text {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #16110a;
  padding: 14px 18px;
  text-align: center;
}
.community-home .home-block-text h1 {
  font-size: clamp(30px, 5vw, 78px);
  margin: 0;
}
.community-home .home-block-text p {
  color: #8a5f18;
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 900;
  margin: 8px 0 0;
}
.community-home .home-block-text small {
  color: #6d5128;
  display: block;
  font-weight: 800;
  margin-top: 6px;
}
.home-hero {
  display: grid;
  gap: 16px;
  justify-items: center;
  min-height: clamp(330px, 42vh, 480px);
  padding: clamp(86px, 9vw, 118px) 12px 26px;
  position: relative;
  text-align: center;
  z-index: 1;
}
.home-logo-badge {
  align-items: center;
  background: linear-gradient(180deg, #111416, #050606);
  border: 2px solid var(--gold);
  border-top: 0;
  box-shadow: 0 16px 28px rgba(0,0,0,.26);
  color: #f7e5b7;
  display: grid;
  justify-items: center;
  min-height: 104px;
  padding: 10px 12px 20px;
  position: absolute;
  right: clamp(18px, 4vw, 70px);
  top: 0;
  width: clamp(86px, 8vw, 118px);
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}
.home-logo-badge img {
  aspect-ratio: 1;
  background: #fff9e9;
  border: 3px solid rgba(214,169,91,.78);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  object-fit: cover;
  width: clamp(58px, 6vw, 82px);
}
.home-brand {
  align-items: center;
  background: linear-gradient(180deg, #111416, #050606);
  border: 2px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  color: #fff7df;
  display: inline-flex;
  gap: 12px;
  padding: 9px 20px;
}
.home-brand strong {
  color: #f0d28c;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}
.home-brand span { color: #f0e1c4; font-weight: 800; }
.home-ornament {
  height: 36px;
  position: relative;
  width: min(370px, 70vw);
}
.home-ornament::before,
.home-ornament::after {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  content: "";
  height: 1px;
  position: absolute;
  top: 50%;
  width: 42%;
}
.home-ornament::before { right: 0; }
.home-ornament::after { left: 0; }
.home-ornament {
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 7px, transparent 8px),
    radial-gradient(circle at 50% 50%, transparent 0 11px, var(--gold) 12px, transparent 13px);
}
.home-hero h1 {
  color: #050606;
  font-size: clamp(54px, 8vw, 116px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 6px 0 rgba(184,135,45,.14);
}
.home-hero p {
  color: #8a5f18;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  margin: 0;
}
.home-editable-hero {
  isolation: isolate;
}
.home-editable-hero .home-zone-hero {
  left: var(--x, 50%);
  position: absolute;
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  width: min(var(--w, 46%), 92%);
  z-index: 2;
}
.home-block-text small {
  color: #6d5128;
  display: block;
  font-size: 16px;
  font-weight: 800;
  margin-top: 8px;
}
.home-block-image {
  display: grid;
  justify-items: center;
  margin: 0;
}
.home-block-image img {
  background: rgba(255,248,229,.9);
  border: 3px solid rgba(184,135,45,.65);
  border-radius: 999px;
  box-shadow: 0 16px 30px rgba(0,0,0,.22);
  max-height: 122px;
  max-width: 100%;
  object-fit: contain;
  padding: 4px;
}
.home-block-image figcaption {
  color: #7b5b2a;
  font-size: 13px;
  font-weight: 800;
  margin-top: 6px;
}
.home-cta {
  align-items: center;
  background: linear-gradient(180deg, #111416, #050606);
  border: 2px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0,0,0,.24);
  color: #fff7e4;
  display: inline-flex;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
  gap: 14px;
  padding: 14px 28px;
}
.home-cta b {
  color: #f0d28c;
  font-size: 15px;
}
.home-service-cards {
  direction: rtl;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1320px;
  position: relative;
  z-index: 2;
}
.home-card {
  align-items: center;
  background: rgba(255,250,241,.9);
  border: 1px solid rgba(184,135,45,.38);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(38,25,10,.11);
  color: #16110a;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 1 calc((100% - 70px) / 8);
  max-width: 156px;
  min-height: 128px;
  min-width: 124px;
  padding: 10px 8px;
  position: relative;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-card-badge {
  align-items: center;
  background: #c92f2f;
  border: 2px solid #fff7ea;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(20, 14, 10, .16);
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  left: 8px;
  min-width: 24px;
  padding-inline: 6px;
  position: absolute;
  top: 8px;
}
.home-card:hover {
  border-color: var(--gold);
  box-shadow: 0 24px 42px rgba(51,34,11,.22);
  transform: translateY(-6px);
}
.home-icon {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #a97419;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.home-icon svg {
  height: 30px;
  width: 30px;
}
.home-icon-image { background: transparent; overflow: hidden; }
.home-icon-image img {
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 0;
  width: 100%;
}
.home-card h3 {
  font-size: clamp(14px, 1.2vw, 18px);
  margin: 0;
}
.home-card p {
  color: #6f6252;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}
.home-card strong {
  color: #9a691c;
  font-size: 12px;
  margin-top: auto;
}
.home-stats {
  align-items: center;
  background: linear-gradient(180deg, #111416, #050606);
  border: 2px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  color: #fff4d7;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px auto 0;
  max-width: 980px;
  min-height: 56px;
  padding: 9px 16px;
  position: relative;
  z-index: 2;
}
.home-stats div { min-width: 82px; }
.home-stats-heading {
  align-items: center;
  display: grid;
  gap: 2px;
  min-width: 96px;
  text-align: center;
}
.home-stats-heading b {
  color: #f0d28c;
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 22px;
  line-height: 1;
}
.home-stats-heading span {
  color: #fff4d7;
  font-size: 11px;
  font-weight: 900;
}
.home-stat-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}
.home-stat-icon {
  color: #d7a348;
  display: inline-flex;
}
.home-stat-icon svg { height: 18px; width: 18px; }
.home-stats b {
  color: #f0d28c;
  font-size: 18px;
}
.home-stats span { font-size: 11px; }
.home-stats i {
  background: rgba(184,135,45,.55);
  display: block;
  height: 32px;
  width: 1px;
}
.home-branch-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 16px auto 0;
  max-width: 1120px;
  position: relative;
  z-index: 2;
}
.home-branch-fields .home-block {
  background: rgba(255,250,241,.9);
  border: 1px solid rgba(184,135,45,.34);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(38,25,10,.1);
  padding: 16px;
}
.branch-home-block {
  outline: 1px dashed rgba(169,116,25,.35);
  outline-offset: 4px;
}
.home-feed-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1330px;
  position: relative;
  z-index: 2;
}

.appearance-admin {
  display: grid;
  gap: 18px;
}
.appearance-editor-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1.35fr) minmax(240px, .65fr);
}
.appearance-page-preview {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.appearance-page-box {
  background:
    linear-gradient(90deg, rgba(255,250,241,.76), rgba(255,244,223,.68)),
    url("/assets/site-background.jpeg?v=1.5.4") left bottom / cover no-repeat;
  aspect-ratio: 16 / 9;
  border: 2px solid rgba(184,135,45,.42);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 18px 34px rgba(38,25,10,.12);
  height: auto;
  min-height: 0;
  width: min(100%, 1120px);
  overflow: hidden;
  position: relative;
}
.appearance-stage-item {
  align-items: center;
  background: rgba(255,250,241,.9);
  border: 1px solid rgba(184,135,45,.45);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(38,25,10,.13);
  color: #16110a;
  cursor: grab;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 58px;
  padding: 8px;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.appearance-stage-item:active { cursor: grabbing; }
.appearance-stage-item span svg {
  color: #a97419;
  height: 28px;
  width: 28px;
}
.appearance-stage-item strong {
  font-size: 13px;
  line-height: 1.35;
}
.appearance-stage-item small {
  color: #6f6252;
  font-size: 11px;
  line-height: 1.4;
}
.appearance-stage-item.type-text {
  background: rgba(255,250,241,.7);
  min-height: 44px;
}
.appearance-stage-item.zone-stats {
  background: linear-gradient(180deg, #111416, #050606);
  color: #fff4d7;
}
.appearance-stage-item.zone-stats small { color: #e8c981; }
.appearance-form {
  background: rgba(255,250,241,.78);
  border: 1px solid rgba(184,135,45,.28);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  padding: 16px;
}
.appearance-form.compact {
  background: transparent;
  border: 0;
  border-radius: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}
.appearance-form label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}
.appearance-form input,
.appearance-form select,
.appearance-form textarea {
  min-height: 44px;
}
.appearance-position-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.appearance-preview-card {
  background: linear-gradient(180deg, rgba(17,20,22,.96), rgba(5,6,6,.96));
  border: 1px solid rgba(184,135,45,.55);
  border-radius: 16px;
  color: #fff4d7;
  padding: 18px;
}
.appearance-preview-card h2 {
  color: #f0d28c;
  margin-top: 0;
}
.appearance-preview-card li {
  margin: 8px 0;
}
.appearance-block-list {
  display: grid;
  gap: 14px;
}
.appearance-block-card {
  background: rgba(255,250,241,.86);
  border: 1px solid rgba(184,135,45,.28);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(38,25,10,.1);
  display: grid;
  gap: 12px;
  padding: 16px;
}
.appearance-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.appearance-card-head strong {
  color: #16110a;
  font-size: 20px;
}
.appearance-card-head span {
  color: #7c6b55;
  font-size: 14px;
}

@media print {
  .topbar, .section-header, .card-actions { display: none !important; }
  main { padding: 0; }
  body { background: #fff; }
  .identity-card, .identity-card-template { border-radius: 0; box-shadow: none; max-width: none; width: 100vw; }
}

@media (max-width: 1180px) {
  .home-feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .topbar { align-items: center; flex-direction: row; }
  .section-header, .card-actions { align-items: stretch; flex-direction: column; }
  .service-grid, .community-columns, .permission-grid, .admin-table-pair, .request-grid, .messages-layout, .calendar-layout, .admin-assignment-form, .admin-user-card, .landing-hero, .directory-filter, .directory-grid, .library-grid, .home-feed-grid, .contact-grid, .contact-form, .appearance-editor-grid, .appearance-form.compact, .appearance-position-grid { grid-template-columns: 1fr; }
  .hijri-calendar-dialog { padding: 12px; width: min(100vw - 20px, 420px); }
  .dual-calendar-top { align-items: flex-start; flex-direction: column; }
  .dual-calendar-selects { grid-template-columns: 1fr; }
  .hijri-calendar-header { grid-template-columns: 40px 1fr 40px; }
  .hijri-calendar-day { min-height: 44px; }
  .landing-hero { text-align: center; }
  .landing-hero > div { justify-items: center; }
  .site-landing { min-height: auto; padding: 14px; }
  .site-landing::before { height: 58px; inset: 10px 10px auto; }
  .landing-quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-quick-links a { min-height: 82px; }
  .site-landing .landing-tree-preview { max-height: 24vh; }
  .site-landing .landing-tree-preview img { max-height: 24vh; }
  .landing-tree-preview { max-height: 34vh; max-width: min(100%, 420px); }
  .landing-tree-preview img { max-height: 34vh; }
  .brand-title { font-size: 16px; }
  .tree-hero { grid-template-columns: 1fr; }
  .tree-search-panel { grid-template-columns: 1fr; }
  .tree-canvas { min-height: 560px; }
  .person-panel {
    border-radius: 18px 18px 10px 10px;
    bottom: 10px;
    left: 10px;
    max-height: 54vh;
    max-width: none;
    overflow: auto;
    right: 10px;
    width: auto;
  }
  .phone-row { grid-template-columns: 1fr; }
  .book-stage { min-height: 70vh; padding: 8px; }
  .book-object, .book-stage iframe { height: 72vh; min-height: 520px; width: 100%; }
  .reader-mode .book-stage { padding: 54px 42px 14px; }
  .reader-mode .book-object, .reader-mode .book-stage iframe { height: calc(100vh - 68px); min-height: 0; }
  .reader-mode .book-reader-head { gap: 6px; padding: 7px 10px; }
  .reader-mode .book-reader-actions .button { min-height: 34px; padding: 6px 10px; }
  .reader-mode .book-controls span { top: 62px; }
  .reader-mode .reader-side { height: 46px; min-height: 46px; padding: 0 10px; }
  .reader-mode .reader-prev { right: 4px; }
  .reader-mode .reader-next { left: 4px; }
  .reader-mode .reader-bookmark { bottom: 8px; left: 8px; min-height: 38px; padding: 7px 10px; }
  .reader-mode [data-reader-status] { display: none; }
  .book-controls button { flex: 1 1 42%; }
  .library-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .identity-card {
    border-width: 5px;
    grid-template-columns: 1fr;
    min-height: 620px;
  }
  .card-ribbon { height: 20%; right: 8%; width: 18%; }
  .identity-logo { padding: 24px 24px 0; }
  .identity-logo img { max-width: 190px; }
  .identity-content { padding: 12px 20px 28px; }
  .card-template-name { font-size: clamp(13px, 3.4vw, 24px); }
  .card-template-branch { font-size: clamp(12px, 2.8vw, 19px); }
  .community-home { border-radius: 0; min-height: calc(100vh - 92px); padding: 12px 8px 74px; }
  .home-logo-badge {
    min-height: 88px;
    padding: 8px 10px 18px;
    right: 12px;
    width: 82px;
  }
  .home-logo-badge img { width: 50px; }
  .community-home::before { display: none; }
  .home-brand { border-radius: 16px; flex-direction: column; gap: 4px; }
  .home-brand span { font-size: 12px; }
  .home-hero { min-height: 360px; padding-top: 28px; }
  .home-editable-hero {
    align-content: center;
    min-height: auto;
  }
  .home-editable-hero .home-zone-hero {
    left: auto;
    position: relative;
    top: auto;
    transform: none;
    width: min(100%, 620px);
  }
  .home-editable-hero .home-block-image img { max-height: 82px; }
  .home-hero h1 { font-size: clamp(42px, 14vw, 62px); }
  .home-hero p { font-size: 18px; padding-inline: 8px; }
  .home-service-cards { gap: 10px; }
  .home-card { flex-basis: min(46%, 144px); min-height: 136px; }
  .home-stats { gap: 6px; }
  .home-stats i { display: none; }
  .footer-ticker-bar { min-height: 30px; }
  .footer-ticker-appname { font-size: 10px; padding: 3px 8px; }
  .footer-motion-slot .moving-footer-group { gap: 32px; padding-inline-end: 32px; }
  .footer-motion-slot .moving-footer-track { animation-duration: 30s; }
  .footer-motion-slot .smart-footer-ad-link { font-size: 12px; }
}

body.view-mobile {
  background: #14100b;
}
body.view-mobile main,
body.view-mobile .topbar,
body.view-mobile .footer-motion-slot {
  margin-inline: auto;
  max-width: 480px;
}
body.view-mobile main {
  border-inline: 1px solid rgba(181, 138, 59, .28);
  min-height: 100vh;
}
body.view-mobile .topbar {
  border-radius: 0 0 18px 18px;
}
body.view-mobile .home-service-cards {
  bottom: 74px;
  gap: 9px;
}
body.view-mobile .home-card {
  flex-basis: min(45%, 150px);
  min-height: 128px;
  padding: 12px;
}
body.view-mobile .tree-board,
body.view-mobile .panel,
body.view-mobile .person-panel {
  border-radius: 12px;
}
body.view-mobile .person-panel {
  inset: auto 10px 54px 10px;
  max-height: 48vh;
  max-width: none;
  overflow: auto;
  position: fixed;
}
body.view-mobile .kh-modal-backdrop {
  align-items: flex-end;
  padding: 8px;
}
body.view-mobile .kh-modal {
  border-radius: 20px 20px 8px 8px;
  max-height: 92vh;
}
body.view-mobile .kh-modal-body {
  max-height: calc(92vh - 64px);
}
body.view-desktop main,
body.view-desktop .topbar {
  max-width: 1380px;
}

/* Header appearance layer: scoped to navigation only, keeps page content/background/icons intact. */
.topbar {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #E7EBEE;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(10, 53, 86, .08);
  color: #0A3556;
  direction: rtl;
  display: block;
  font-family: "Cairo", "Almarai", "Montserrat", sans-serif;
  min-height: 0;
  padding: 0;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1200;
}
.topbar-inner {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1322px;
  padding: 18px;
  width: 100%;
}
.topbar-brand {
  align-items: center;
  color: #0A3556;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
  min-height: 40px;
  white-space: nowrap;
}
.topbar .desktop-nav {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: flex-start;
  overflow: visible;
}
.topbar .desktop-nav a {
  align-items: center;
  border: 0;
  border-radius: 4px;
  color: #0A3556;
  display: inline-flex;
  font-size: 16px;
  font-weight: 800;
  gap: 10px;
  line-height: 1.2;
  min-height: 40px;
  padding: 8px 12px;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.topbar .desktop-nav a:hover {
  background: transparent;
  border-color: transparent;
  color: #5E9199;
}
.topbar .desktop-nav a.login-link,
.topbar .desktop-nav a.logout-link {
  background: #BC9975;
  border: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  min-width: 150px;
  padding: 10px 20px;
}
.topbar .desktop-nav a.login-link:hover,
.topbar .desktop-nav a.logout-link:hover {
  background: #AF8357;
  color: #fff;
}
.topbar .desktop-nav a.login-link::before {
  height: 14px;
  width: 12px;
}
.topbar svg,
.topbar img,
.mobile-menu svg,
.mobile-menu img {
  flex: 0 0 auto;
  max-height: 24px;
  max-width: 24px;
}
.topbar .desktop-nav a.login-link svg,
.topbar .desktop-nav a.logout-link svg,
.mobile-logout-button svg {
  height: 20px;
  width: 20px;
}
.mobile-header-actions {
  align-items: center;
  display: none;
  gap: 16px;
}
.mobile-menu-toggle,
.mobile-menu-close {
  align-items: center;
  background: #fff;
  border: 1px solid #E7EBEE;
  border-radius: 4px;
  color: #0A3556;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}
.mobile-menu-toggle {
  flex-direction: column;
  gap: 5px;
}
.mobile-menu-toggle span {
  background: currentColor;
  border-radius: 99px;
  display: block;
  height: 2px;
  width: 22px;
}
.mobile-menu-close {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.mobile-menu[hidden] { display: none !important; }
.mobile-menu {
  background: #fff;
  bottom: auto;
  color: #0A3556;
  direction: rtl;
  height: 124vh;
  left: 0;
  overflow: hidden;
  position: fixed;
  right: 0;
  top: 0;
  width: 100%;
  z-index: 1400;
}
.mobile-menu-head {
  align-items: center;
  border-bottom: 1px solid #E7EBEE;
  display: flex;
  justify-content: space-between;
  padding: 18px;
}
.mobile-menu-body {
  background: #F7F9FC;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - 84px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
}
.mobile-menu-body a {
  align-items: center;
  border: 0;
  border-bottom: 1px solid #E7EBEE;
  border-radius: 0;
  color: #0A3556;
  display: flex;
  font-size: 16px;
  font-weight: 800;
  justify-content: space-between;
  min-height: 56px;
  padding: 16px 0;
}
.mobile-menu-body a:hover {
  color: #5E9199;
}
.mobile-logout-button {
  align-items: center;
  background: #0A3556;
  border-radius: 12px;
  color: #fff !important;
  display: flex;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
  height: 52px;
  justify-content: center;
  margin-top: 14px;
  padding: 10px 12px;
  position: static;
  width: 100%;
}
.mobile-logout-button:hover {
  background: #09304E;
  color: #fff !important;
}
body.mobile-menu-open {
  overflow: hidden;
}
body.view-desktop .topbar,
body.view-mobile .topbar {
  max-width: none;
}

@media (min-width: 1280px) {
  .mobile-menu,
  .mobile-header-actions {
    display: none !important;
  }
}

@media (max-width: 1279px) {
  .topbar,
  body.view-mobile .topbar,
  body.view-desktop .topbar {
    margin: 0;
    max-width: none;
    width: 100%;
  }
  .topbar-inner {
    margin: 0;
    padding: 18px;
  }
  .topbar .desktop-nav {
    display: none;
  }
  .mobile-header-actions {
    display: flex;
  }
  .topbar-brand {
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Global typography layer: unifies the visual language without changing backgrounds or icon assets. */
:root {
  --font-main: "Cairo", "Almarai", "Montserrat", Tahoma, Arial, sans-serif;
}
html,
body {
  font-family: var(--font-main);
  letter-spacing: 0;
}
body {
  font-weight: 600;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea,
.button,
.secondary-button,
.topbar,
.mobile-menu,
.footer-motion-slot,
.system-footer-actions {
  font-family: var(--font-main);
  letter-spacing: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
.hero h1,
.section-header h1,
.tree-hero h1,
.landing-copy h1,
.landing-hero h1,
.home-hero h1,
.home-brand span,
.brand-title,
.compact-brand span,
.home-stats-heading b,
.kh-modal header h2,
.node-card .deceased-badge,
.node-card .deceased-badge text {
  font-family: var(--font-main) !important;
  font-weight: 800;
  letter-spacing: 0;
}
h1,
.section-header h1,
.tree-hero h1 {
  line-height: 1.25;
}
h2,
h3,
.community-panel h2,
.request-column h2,
.admin-section h2 {
  line-height: 1.35;
}
p,
li,
dd,
dt,
.hint,
.content-card p,
.service-grid p,
.directory-card p,
.library-card p,
.permission-grid p,
.home-card p,
.message-thread p,
.content-detail p {
  line-height: 1.8;
}
label {
  color: #56656a;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}
input,
select,
textarea {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}
button,
.button,
.secondary-button {
  align-items: center;
  font-size: 15px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.4;
}
.hero,
.panel,
.login-card,
.tree-hero,
.tree-board,
.person-panel,
.community-panel,
.service-card,
.content-card,
.directory-card,
.library-card,
.request-card,
.admin-user-card,
.home-card,
.kh-modal,
.mobile-menu {
  font-family: var(--font-main);
}
.eyebrow,
.stats span,
.nav-bell,
.request-bell,
.home-card strong,
.home-stats span,
.footer-ticker-appname,
.system-footer-actions span {
  font-family: var(--font-main);
  font-weight: 800;
  letter-spacing: 0;
}
.home-hero h1 {
  font-size: clamp(48px, 7vw, 104px);
}
.home-hero p {
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1.55;
}
.landing-copy h1 {
  font-size: clamp(48px, 8vw, 104px);
  line-height: 1.12;
}
.lineage-text {
  font-family: var(--font-main);
  line-height: 1.45 !important;
}
.home-card h3 {
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.45;
}
.home-card p {
  font-size: 12px;
  font-weight: 700;
}
.home-icon,
.home-icon svg,
.service-grid svg,
.content-card svg,
.topbar svg,
.mobile-menu svg {
  font-family: inherit;
}
.card-template-text {
  font-family: var(--font-main);
  line-height: 1.18;
}
.node-card text {
  font-family: var(--font-main);
}
.node-card .name {
  font-size: 12.5px;
  font-weight: 800;
}
.node-card .sub {
  font-size: 9.5px;
  font-weight: 700;
}
.node-card .pending-label {
  font-size: 8px;
}
.node-card .deceased-badge {
  font-size: 6px;
  font-weight: 800;
}
@media (max-width: 760px) {
  body {
    line-height: 1.65;
  }
  button,
  .button,
  .secondary-button {
    font-size: 14px;
  }
  .home-card h3 {
    font-size: 14px;
  }
  .home-card p,
  .home-card strong {
    font-size: 11px;
  }
}

/* Final layout tuning: wider hero block, real appearance preview, and tree person modal. */
.community-home .home-zone-hero.home-block-text,
.home-editable-hero .home-zone-hero.home-block-text {
  max-width: 1180px;
  width: min(1180px, calc(100% - clamp(28px, 6vw, 88px))) !important;
}
.community-home .home-block-text {
  padding-inline: clamp(20px, 3.5vw, 46px);
}
.appearance-preview-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.appearance-preview-toolbar output {
  background: rgba(255,250,241,.88);
  border: 1px solid rgba(184,135,45,.28);
  border-radius: 999px;
  color: #6d5128;
  font-weight: 900;
  min-width: 72px;
  padding: 9px 14px;
  text-align: center;
}
.appearance-page-box-shell {
  background: rgba(255,250,241,.46);
  border-radius: 18px;
  overflow: auto;
  padding: 12px;
}
.appearance-page-box {
  transform: scale(var(--appearance-zoom, 1));
  transform-origin: top center;
  transition: transform .18s ease;
}
.appearance-stage-item {
  outline-offset: 3px;
}
.appearance-stage-item:hover {
  border-color: var(--gold);
}
.appearance-resize-handle {
  background: linear-gradient(135deg, transparent 0 42%, rgba(169,116,25,.9) 43% 58%, transparent 59% 100%);
  border: 1px solid rgba(169,116,25,.5);
  border-radius: 4px;
  bottom: 5px;
  cursor: ew-resize;
  height: 18px;
  left: 5px;
  position: absolute;
  touch-action: none;
  width: 18px;
}
.appearance-form.is-focused {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,135,45,.18), 0 18px 32px rgba(38,25,10,.12);
}
.tree-page .person-panel {
  display: none !important;
}
.person-details-modal .kh-modal-backdrop {
  align-items: center;
  padding: clamp(12px, 3vw, 28px);
}
.person-details-modal .kh-modal {
  max-height: min(88vh, 840px);
  max-width: 960px;
  width: min(960px, calc(100vw - 24px));
}
.person-details-modal .kh-modal-body {
  max-height: min(74vh, 710px);
  overflow: auto;
}
.person-modal-content {
  display: grid;
  gap: 16px;
}
.person-modal-content h2 {
  margin: 0;
}
.person-modal-content dl {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.person-modal-content dl > div {
  background: rgba(255,250,241,.72);
  border: 1px solid rgba(184,135,45,.2);
  border-radius: 12px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}
.person-modal-content dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.person-modal-content dd {
  color: var(--ink);
  font-weight: 900;
  margin: 0;
}
.person-modal-content .profile-form,
.person-modal-content .tree-role-form {
  background: rgba(255,250,241,.78);
  border: 1px solid rgba(184,135,45,.22);
  border-radius: 16px;
  padding: 14px;
}
.person-modal-content .panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}
@media (max-width: 760px) {
  .community-home {
    gap: 14px;
    justify-content: flex-start;
    padding-top: 16px;
  }
  .home-editable-layer {
    display: grid;
    gap: 10px;
    inset: auto;
    min-height: 190px;
    pointer-events: auto;
    position: relative;
    width: 100%;
  }
  .community-home .home-zone-hero,
  .home-editable-hero .home-zone-hero {
    left: auto;
    margin-inline: auto;
    position: relative;
    top: auto;
    transform: none;
    width: min(100%, 620px) !important;
  }
  .home-service-cards {
    margin-top: 6px;
  }
  .appearance-page-box {
    aspect-ratio: 390 / 760;
    max-width: 430px;
    width: min(100%, 430px);
  }
  .community-home .home-zone-hero.home-block-text,
  .home-editable-hero .home-zone-hero.home-block-text {
    width: min(100%, 620px) !important;
  }
  .appearance-preview-toolbar .button,
  .appearance-preview-toolbar output {
    flex: 1 1 150px;
  }
  .person-details-modal .kh-modal-backdrop {
    align-items: flex-end;
    padding: 8px;
  }
  .person-details-modal .kh-modal {
    border-radius: 20px 20px 8px 8px;
    max-height: 92vh;
  }
  .person-details-modal .kh-modal-body {
    max-height: calc(92vh - 70px);
  }
  .person-modal-content dl {
    grid-template-columns: 1fr;
  }
}

/* Mobile menu, ticker management, and navigation loading feedback. */
.mobile-menu-body {
  align-content: start;
  align-items: stretch;
  display: flex;
  justify-content: flex-start;
  gap: 0;
  padding-top: 12px;
}
.mobile-menu-body a {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #E7EBEE;
  border-radius: 0;
  box-shadow: none;
  color: #0A3556 !important;
  flex-direction: row;
  gap: 0;
  justify-content: space-between;
  min-height: 58px;
  padding: 16px 0;
  text-align: start;
}
.mobile-menu-body a:visited {
  color: #0A3556 !important;
}
.mobile-menu-body a:active,
.mobile-menu-body a:focus-visible,
.mobile-menu-body a:hover {
  background: rgba(10, 53, 86, .06);
  color: #5E9199 !important;
}
.mobile-menu-body .mobile-logout-button,
.mobile-menu-body .mobile-logout-button:visited {
  background: #0A3556;
  border-radius: 12px;
  color: #fff !important;
  justify-content: center;
  margin-top: 14px;
  padding: 14px 12px;
}
.mobile-menu-body .mobile-logout-button:active,
.mobile-menu-body .mobile-logout-button:focus-visible,
.mobile-menu-body .mobile-logout-button:hover {
  background: #09304E;
  color: #fff !important;
}

.profile-summary-card,
.my-bio-preview {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(188, 153, 117, .36);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(22, 16, 8, .10);
  margin: 18px 0;
  padding: 18px;
}
.profile-summary-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.profile-summary-head span {
  color: #9b7439;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.profile-summary-head h2 {
  color: #17110b;
  font-size: clamp(22px, 4vw, 34px);
  margin: 0;
}
.profile-summary-head small,
.profile-summary-card dd[dir="ltr"],
.my-bio-preview small[dir="ltr"],
.my-bio-preview small span[dir="ltr"] {
  background: rgba(10, 53, 86, .08);
  border: 1px solid rgba(10, 53, 86, .12);
  border-radius: 999px;
  color: #0A3556;
  display: inline-flex;
  font-family: Montserrat, Cairo, sans-serif;
  font-weight: 800;
  padding: 5px 10px;
}
.profile-summary-card dl {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.profile-summary-card dl > div {
  background: rgba(247, 242, 233, .72);
  border: 1px solid rgba(188, 153, 117, .18);
  border-radius: 12px;
  padding: 11px 12px;
}
.profile-summary-card dt {
  color: #8c6935;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}
.profile-summary-card dd {
  color: #19130d;
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}
.my-bio-preview {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 132px minmax(0, 1fr);
}
.my-bio-preview img,
.bio-image-placeholder {
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, .14);
  height: auto;
  object-fit: cover;
  width: 132px;
}
.bio-image-placeholder {
  align-items: center;
  background: linear-gradient(145deg, rgba(188,153,117,.20), rgba(10,53,86,.10));
  border: 1px dashed rgba(188, 153, 117, .62);
  color: #8c6935;
  display: flex;
  font-weight: 900;
  justify-content: center;
}
.my-bio-preview h2 {
  margin-top: 4px;
}
.my-bio-preview .empty {
  text-align: start;
}

.mobile-menu {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: flex-start;
}
.mobile-menu-body {
  flex: 1 1 auto;
  height: auto !important;
  justify-content: flex-start !important;
  padding-bottom: 96px !important;
  padding-top: 10px !important;
}
@media (max-width: 768px) {
  .login-shell {
    align-items: start;
    min-height: auto;
    padding: 12px 8px 24px;
    place-items: start stretch;
  }
  .login-card {
    max-width: none;
    padding: 20px 16px;
    width: 100%;
  }
  .login-card h1 {
    font-size: 24px;
    line-height: 1.35;
  }
  .login-card label {
    display: grid;
    gap: 8px;
    line-height: 1.55;
  }
  .login-card input,
  .login-card select,
  .login-card button,
  .calendar-form input,
  .calendar-form select,
  .calendar-form textarea {
    font-size: 16px;
    min-height: 48px;
    width: 100%;
  }
  .calendar-form label {
    gap: 8px;
    line-height: 1.6;
  }
  .site-landing {
    padding: 18px 12px 24px;
  }
  .landing-copy h1 {
    font-size: clamp(38px, 13vw, 60px);
    line-height: 1.2;
  }
  .lineage-text {
    font-size: 16px !important;
    max-width: 100%;
    padding: 10px 16px;
  }
  .profile-summary-card dl,
  .my-bio-preview {
    grid-template-columns: 1fr;
  }
  .my-bio-preview img,
  .bio-image-placeholder {
    margin-inline: auto;
    width: min(148px, 42vw);
  }
  .footer-motion-slot .moving-footer-track {
    animation-duration: var(--ticker-mobile-duration, 72s) !important;
  }
  .tree-canvas {
    min-height: 68vh;
    padding: 8px 0;
  }
  .node-card .plus circle {
    stroke-width: 1.2;
  }
  .node-card .plus text {
    font-size: 16px;
  }
  .node-card .family-jump {
    transform: scale(.86);
    transform-box: fill-box;
    transform-origin: center;
  }
}
.ticker-edit-details {
  background: rgba(255,250,241,.62);
  border: 1px solid rgba(184,135,45,.22);
  border-radius: 12px;
  margin-top: 12px;
  padding: 10px;
}
.ticker-edit-details summary {
  color: #6d5128;
  cursor: pointer;
  font-weight: 900;
}
.ticker-inline-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.danger-button {
  background: #7f1d1d;
  color: #fff;
}
.page-loading-overlay {
  align-items: center;
  background: rgba(10, 12, 12, .42);
  backdrop-filter: blur(3px);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 2147482500;
}
.page-loading-overlay[hidden] {
  display: none !important;
}
.page-loading-card {
  align-items: center;
  background: rgba(255,250,241,.96);
  border: 1px solid rgba(184,135,45,.45);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  color: #16110a;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 220px;
  padding: 24px;
}
.page-loading-card small {
  color: #6d5128;
  font-weight: 800;
}
.page-loading-spinner {
  animation: loading-spin 1s linear infinite;
  border: 4px solid rgba(184,135,45,.24);
  border-top-color: #BC9975;
  border-radius: 999px;
  height: 46px;
  width: 46px;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
.context-back-row {
  align-items: center;
  display: flex;
  justify-content: flex-start;
  margin: 12px auto 0;
  max-width: 1180px;
  padding-inline: clamp(14px, 3vw, 22px);
  width: 100%;
}

/* Final override: back controls must stay small, red, and visible after global button rules. */
a.back-button-small,
button.back-button-small,
.button.back-button-small,
.secondary-button.back-button-small {
  background: #7f1d1d !important;
  border-color: #7f1d1d !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(127, 29, 29, .18) !important;
  color: #fff !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  gap: 6px !important;
  justify-content: center !important;
  line-height: 1.2 !important;
  margin-block: 10px 0 !important;
  min-height: 0 !important;
  padding: 6px 12px !important;
  text-decoration: none !important;
  width: fit-content !important;
}
a.back-button-small:hover,
button.back-button-small:hover,
.button.back-button-small:hover,
.secondary-button.back-button-small:hover {
  background: #991b1b !important;
  border-color: #991b1b !important;
  color: #fff !important;
}

/* Public landing page inspired by the approved desktop/mobile references. */
.landing-public-page {
  background: #f2ece5;
  color: #2f3a3d;
  font-family: "Cairo", "Almarai", "Montserrat", sans-serif;
}
.landing-public-page .topbar,
.landing-public-page .system-footer-actions {
  display: none !important;
}
.landing-public-page main {
  max-width: none;
  padding: 0;
}
.landing-public-page .site-landing {
  --landing-deep: #073f46;
  --landing-deep-2: #06434a;
  --landing-gold: #b88a3a;
  --landing-cream: #f7f2ec;
  --landing-text: #2f3a3d;
  --landing-line: #e6ded4;
  align-items: center;
  background: linear-gradient(180deg, #eef6f4 0%, #f5efe8 65%, #f2ece5 100%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--landing-text);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  max-width: none;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 clamp(16px, 3vw, 36px) 56px;
  position: relative;
  text-align: center;
}
.landing-public-page .site-landing::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(246, 240, 232, .08) 48%, rgba(246, 240, 232, .76) 100%),
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, .78), transparent 22%),
    linear-gradient(90deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .62) 48%, rgba(255, 255, 255, .06)),
    url("/assets/site-background.jpeg?v=1.7.4") left bottom / cover no-repeat;
  border: 0;
  border-radius: 0;
  content: "";
  height: clamp(520px, 65vh, 690px);
  inset: 0 0 auto;
  position: absolute;
  z-index: 0;
}
.landing-public-page .site-landing::after {
  background: linear-gradient(180deg, transparent, rgba(242, 236, 229, .9) 76%, #f2ece5);
  color: transparent;
  content: "";
  height: 170px;
  inset: clamp(390px, 52vh, 570px) 0 auto;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}
.landing-shield {
  align-items: center;
  background: linear-gradient(180deg, #07464d, #04353b);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 0 0 42px 42px;
  box-shadow: 0 16px 34px rgba(5, 35, 39, .22);
  color: var(--landing-gold);
  display: flex;
  height: clamp(122px, 12vw, 176px);
  justify-content: center;
  position: absolute;
  right: clamp(52px, 8vw, 150px);
  top: 0;
  width: clamp(82px, 8vw, 118px);
  z-index: 2;
}
.landing-shield::after {
  border-left: clamp(41px, 4vw, 59px) solid transparent;
  border-right: clamp(41px, 4vw, 59px) solid transparent;
  border-top: 22px solid #04353b;
  bottom: -21px;
  content: "";
  position: absolute;
}
.landing-shield svg {
  height: 62%;
  width: 62%;
}
.landing-hero-content {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: clamp(520px, 64vh, 680px);
  padding-top: clamp(70px, 9vh, 118px);
  position: relative;
  width: min(100%, 1120px);
  z-index: 1;
}
.landing-ornament {
  align-items: center;
  color: var(--landing-gold);
  display: inline-flex;
  gap: 10px;
  margin-bottom: clamp(12px, 2vh, 22px);
}
.landing-ornament span {
  background: currentColor;
  display: block;
  height: 2px;
  opacity: .7;
  width: clamp(54px, 6vw, 90px);
}
.landing-ornament i,
.landing-ornament b {
  border: 2px solid currentColor;
  display: block;
  transform: rotate(45deg);
}
.landing-ornament i {
  height: 8px;
  width: 8px;
}
.landing-ornament b {
  height: 18px;
  width: 18px;
}
.landing-public-page .landing-hero-content h1 {
  color: var(--landing-deep);
  font-size: clamp(58px, 6vw, 96px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
  max-width: 100%;
}
.landing-lineage {
  color: var(--landing-gold);
  font-size: clamp(22px, 2.15vw, 36px);
  font-weight: 800;
  line-height: 1.6;
  margin: 8px 0 0;
}
.landing-slogan {
  color: #253437;
  font-size: clamp(21px, 1.8vw, 32px);
  font-weight: 700;
  line-height: 1.7;
  margin: 18px 0 0;
}
.landing-gold-rule {
  background: var(--landing-gold);
  border-radius: 99px;
  display: block;
  height: 2px;
  margin: 10px 0 24px;
  opacity: .75;
  width: 92px;
}
.landing-login-button {
  align-items: center;
  background: linear-gradient(180deg, #08535b, #043d44);
  border: 1px solid rgba(184, 138, 58, .44);
  border-radius: 16px;
  box-shadow: 0 15px 28px rgba(4, 49, 54, .26);
  color: var(--landing-gold);
  display: inline-flex;
  font-size: clamp(18px, 1.55vw, 25px);
  font-weight: 900;
  gap: 14px;
  justify-content: center;
  min-height: 74px;
  min-width: clamp(260px, 23vw, 360px);
  padding: 16px 34px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.landing-login-button svg {
  height: 30px;
  width: 30px;
}
.landing-login-button:hover,
.landing-login-button:focus-visible {
  background: linear-gradient(180deg, #0a626b, #06434a);
  box-shadow: 0 18px 38px rgba(4, 49, 54, .32);
  color: #d5ad62;
  transform: translateY(-2px);
}
.landing-family-card {
  background: rgba(247, 242, 236, .96);
  border: 1px solid rgba(230, 222, 212, .92);
  border-radius: 36px;
  box-shadow: 0 24px 70px rgba(30, 43, 46, .15);
  margin-top: -58px;
  max-width: 1260px;
  padding: 88px clamp(28px, 5vw, 86px) 0;
  position: relative;
  width: min(100%, 1260px);
  z-index: 2;
}
.landing-card-emblem {
  align-items: center;
  background: #fffaf4;
  border: 1px solid rgba(230, 222, 212, .9);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(25, 25, 20, .13);
  color: var(--landing-gold);
  display: flex;
  height: 116px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: -58px;
  transform: translateX(-50%);
  width: 116px;
}
.landing-card-emblem svg {
  height: 62%;
  width: 62%;
}
.landing-family-card h2 {
  color: var(--landing-deep);
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 12px;
}
.landing-card-intro {
  color: #243437;
  font-size: clamp(18px, 1.45vw, 25px);
  font-weight: 600;
  line-height: 1.95;
  margin: 0 auto clamp(34px, 4vw, 58px);
  max-width: 840px;
}
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-inline: auto;
  max-width: 980px;
}
.landing-feature {
  align-items: center;
  border-inline-start: 1px solid var(--landing-line);
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 6px clamp(14px, 2vw, 34px) 20px;
}
.landing-feature:last-child {
  border-inline-start: 0;
}
.landing-feature-icon {
  align-items: center;
  background: #eee7de;
  border-radius: 16px;
  color: var(--landing-deep);
  display: flex;
  height: 70px;
  justify-content: center;
  margin-bottom: 20px;
  width: 70px;
}
.landing-feature-icon svg {
  height: 42px;
  width: 42px;
}
.landing-feature h3 {
  color: #14272b;
  font-size: clamp(20px, 1.6vw, 27px);
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 10px;
}
.landing-feature p {
  color: #2f3a3d;
  font-size: clamp(15px, 1.1vw, 19px);
  font-weight: 600;
  line-height: 1.9;
  margin: 0;
}
.landing-card-footer {
  border-top: 1px solid var(--landing-line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(28px, 3.2vw, 50px) clamp(-28px, -5vw, -86px) 0;
}
.landing-card-footer span {
  align-items: center;
  border-inline-start: 1px solid var(--landing-line);
  color: #263538;
  display: inline-flex;
  font-size: clamp(15px, 1.1vw, 19px);
  font-weight: 700;
  gap: 10px;
  justify-content: center;
  min-height: 78px;
  padding: 18px 14px;
}
.landing-card-footer span:last-child {
  border-inline-start: 0;
}
.landing-card-footer svg {
  color: var(--landing-deep);
  height: 28px;
  width: 28px;
}

@media (max-width: 1023px) {
  .landing-public-page .site-landing::before {
    height: clamp(500px, 61vh, 640px);
  }
  .landing-hero-content {
    min-height: clamp(500px, 61vh, 640px);
  }
  .landing-shield {
    right: clamp(24px, 8vw, 78px);
  }
  .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .landing-feature {
    border-block-start: 1px solid var(--landing-line);
    min-height: 220px;
  }
  .landing-feature:nth-child(1),
  .landing-feature:nth-child(2) {
    border-block-start: 0;
  }
  .landing-feature:nth-child(even) {
    border-inline-start: 0;
  }
  .landing-family-card {
    margin-top: -52px;
    padding-top: 78px;
  }
}

@media (max-width: 767px) {
  .landing-public-page .site-landing {
    padding: 0 4vw 42px;
  }
  .landing-public-page .site-landing::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(246, 240, 232, .08) 48%, rgba(246, 240, 232, .78) 100%),
      radial-gradient(circle at 50% 12%, rgba(255, 255, 255, .74), transparent 30%),
      linear-gradient(90deg, rgba(255, 255, 255, .52), rgba(255, 255, 255, .3)),
      url("/assets/site-background.jpeg?v=1.7.4") 18% bottom / cover no-repeat;
    height: clamp(520px, 58vh, 640px);
  }
  .landing-public-page .site-landing::after {
    inset: clamp(430px, 50vh, 540px) 0 auto;
  }
  .landing-shield {
    border-radius: 0 0 30px 30px;
    height: 112px;
    right: 24px;
    width: 72px;
  }
  .landing-shield::after {
    border-left-width: 36px;
    border-right-width: 36px;
    border-top-width: 17px;
    bottom: -16px;
  }
  .landing-hero-content {
    min-height: clamp(520px, 58vh, 640px);
    padding-top: 86px;
  }
  .landing-ornament {
    gap: 7px;
    margin-bottom: 12px;
  }
  .landing-ornament span {
    width: 44px;
  }
  .landing-public-page .landing-hero-content h1 {
    font-size: clamp(42px, 11vw, 58px);
    max-width: 10ch;
  }
  .landing-lineage {
    font-size: clamp(20px, 5vw, 26px);
    margin-top: 12px;
  }
  .landing-slogan {
    font-size: clamp(18px, 4.6vw, 24px);
    margin-top: 12px;
  }
  .landing-gold-rule {
    margin-bottom: 18px;
    width: 74px;
  }
  .landing-login-button {
    border-radius: 14px;
    font-size: 20px;
    min-height: 62px;
    min-width: min(76vw, 330px);
    padding: 12px 22px;
  }
  .landing-login-button svg {
    height: 27px;
    width: 27px;
  }
  .landing-family-card {
    border-radius: 30px;
    margin-top: -44px;
    padding: 72px 22px 0;
    width: min(92vw, 520px);
  }
  .landing-card-emblem {
    height: 96px;
    top: -48px;
    width: 96px;
  }
  .landing-family-card h2 {
    font-size: clamp(28px, 7vw, 40px);
  }
  .landing-card-intro {
    font-size: clamp(17px, 4.2vw, 22px);
    line-height: 1.9;
    margin-bottom: 28px;
  }
  .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .landing-feature {
    min-height: 230px;
    padding: 20px 10px;
  }
  .landing-feature-icon {
    border-radius: 14px;
    height: 64px;
    margin-bottom: 16px;
    width: 64px;
  }
  .landing-feature-icon svg {
    height: 38px;
    width: 38px;
  }
  .landing-feature h3 {
    font-size: clamp(18px, 5vw, 24px);
  }
  .landing-feature p {
    font-size: clamp(14px, 3.8vw, 18px);
  }
  .landing-card-footer {
    grid-template-columns: 1fr;
    margin-inline: -22px;
  }
  .landing-card-footer span,
  .landing-card-footer span:last-child {
    border-inline-start: 0;
    border-top: 1px solid var(--landing-line);
    min-height: 66px;
  }
}

/* v1.8.8 notifications, recipient search and unified calendar. */
.notification-bell-button {
  align-items: center;
  background: linear-gradient(135deg, #f5c84b, #b88a3a);
  border: 1px solid rgba(7, 63, 70, .18);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(7, 63, 70, .18);
  color: #073f46;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  left: 18px;
  position: fixed;
  text-decoration: none;
  top: 86px;
  width: 44px;
  z-index: 1600;
}
.notification-bell-icon {
  font-size: 22px;
  line-height: 1;
}
.notification-bell-count {
  align-items: center;
  background: #c92f2f;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding-inline: 5px;
  position: absolute;
  right: -8px;
  top: -8px;
}
.hijri-calendar-day.is-selected {
  background: rgba(184, 138, 58, .18);
  border: 1px solid rgba(184, 138, 58, .4);
  color: var(--deep);
  font-weight: 800;
}
.notification-popup-backdrop {
  align-items: center;
  background: rgba(6, 32, 36, .52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 2200;
}
.notification-popup-card {
  background: rgba(255, 252, 247, .98);
  border: 1px solid rgba(184, 138, 58, .34);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(7, 63, 70, .26);
  color: #073f46;
  max-width: 520px;
  padding: 28px;
  text-align: center;
  width: min(100%, 520px);
}
.notification-popup-card h2 {
  margin: 8px 0 12px;
}
.notification-popup-card small {
  color: rgba(47, 58, 61, .78);
  display: block;
  margin: 12px 0;
}
.notification-page-grid,
.admin-notification-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.notification-panel {
  align-self: start;
}
.notification-list {
  display: grid;
  gap: 12px;
}
.notification-card,
.poll-card {
  background: rgba(255, 252, 247, .92);
  border: 1px solid rgba(184, 138, 58, .2);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(7, 63, 70, .08);
  display: grid;
  gap: 12px;
  padding: 16px;
}
.notification-card.is-unread {
  border-color: rgba(184, 138, 58, .56);
  box-shadow: 0 14px 32px rgba(184, 138, 58, .15);
}
.notification-card strong,
.poll-card strong {
  color: #073f46;
  display: block;
  font-size: 18px;
}
.notification-card p,
.poll-card p {
  color: #2f3a3d;
  margin: 8px 0;
}
.notification-card small,
.poll-card small {
  color: rgba(47, 58, 61, .72);
}
.poll-vote-form {
  display: grid;
  gap: 10px;
}
.poll-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.poll-results span {
  background: rgba(7, 63, 70, .06);
  border-radius: 12px;
  padding: 10px;
}
.poll-results strong,
.poll-results small {
  display: block;
}
@media (max-width: 767px) {
  .notification-bell-button {
    height: 40px;
    left: 12px;
    top: 74px;
    width: 40px;
  }
  .notification-popup-card {
    border-radius: 18px;
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .landing-public-page .landing-hero-content h1 {
    font-size: clamp(38px, 10.5vw, 48px);
  }
  .landing-lineage {
    font-size: 18px;
  }
  .landing-slogan {
    max-width: 12ch;
  }
  .landing-feature {
    min-height: 214px;
    padding-inline: 8px;
  }
}

/* Authenticated area background: use the new clean valley artwork after login only. */
body[data-authenticated="1"] {
  background:
    linear-gradient(90deg, rgba(244, 238, 230, .94), rgba(244, 238, 230, .72) 48%, rgba(244, 238, 230, .9)),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(246, 240, 232, .78)),
    url("/assets/after-login-desktop-bg.png?v=1.7.5") center center / cover fixed no-repeat,
    #f4eee6;
}

@media (max-width: 767px) {
  body[data-authenticated="1"] {
    background:
      linear-gradient(180deg, rgba(244, 238, 230, .78), rgba(244, 238, 230, .95)),
      linear-gradient(90deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .46)),
      url("/assets/after-login-mobile-bg.png?v=1.7.5") center top / cover scroll no-repeat,
      #f4eee6;
  }
}

/* v1.8.8 exact public landing reference and clearer authenticated background. */
.landing-public-page .site-landing {
  background: transparent !important;
  display: block !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  min-width: 100vw;
  width: 100%;
}
.landing-public-page .site-landing::before,
.landing-public-page .site-landing::after,
.landing-public-page .landing-shield,
.landing-public-page .landing-family-card,
.landing-public-page .landing-ornament,
.landing-public-page .landing-hero-content h1,
.landing-public-page .landing-lineage,
.landing-public-page .landing-slogan,
.landing-public-page .landing-gold-rule {
  display: none !important;
}
.landing-public-page .landing-hero-content {
  inset: 0;
  min-height: 0;
  padding: 0;
  position: absolute;
  width: 100%;
  z-index: 3;
}
.landing-public-page .landing-login-button {
  border: 0 !important;
  box-shadow: none !important;
  height: clamp(58px, 7vh, 86px) !important;
  left: 50%;
  min-height: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding: 0 !important;
  position: absolute;
  top: 40%;
  transform: translate(-50%, -50%) !important;
  width: clamp(250px, 19vw, 380px) !important;
}
.landing-public-page .landing-login-button:focus-visible {
  opacity: .08;
  outline: 3px solid #b88a3a;
  outline-offset: 8px;
}
body[data-authenticated="1"] {
  background: url("/assets/after-login-desktop-bg.jpg?v=1.8.8") center center / cover fixed no-repeat #f4eee6 !important;
}
body[data-authenticated="1"] main {
  background: transparent;
  max-width: none;
}
body[data-authenticated="1"] .community-home {
  align-items: center;
  margin-inline: auto;
  max-width: 1320px;
  text-align: center;
  width: min(100%, 1320px);
}
body[data-authenticated="1"] .home-editable-layer {
  inset-inline: 0;
  margin-inline: auto;
  max-width: 1320px;
  width: 100%;
}
body[data-authenticated="1"] .community-home .home-zone-hero,
body[data-authenticated="1"] .home-editable-hero .home-zone-hero {
  left: 50% !important;
  right: auto !important;
  text-align: center;
  transform: translate(-50%, -50%) !important;
}
body[data-authenticated="1"] .home-service-cards,
body[data-authenticated="1"] .home-stats {
  margin-inline: auto;
}
.login-page {
  background: url("/assets/after-login-desktop-bg.jpg?v=1.8.8") center center / cover fixed no-repeat #f4eee6 !important;
}
.login-page main {
  display: grid;
  min-height: calc(100vh - 64px);
  place-items: center;
}
.login-page .login-shell {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
  width: 100%;
}
@media (max-width: 767px) {
  .landing-public-page .site-landing {
    background: transparent !important;
    min-height: max(100dvh, calc(100vw * 2.083)) !important;
  }
  .landing-public-page .landing-login-button {
    height: clamp(54px, 7vw, 70px) !important;
    top: 28.4%;
    width: min(46vw, 240px) !important;
  }
  body[data-authenticated="1"] {
    background: url("/assets/after-login-mobile-bg.jpg?v=1.8.8") center top / cover scroll no-repeat #f4eee6 !important;
  }
  .login-page {
    background: url("/assets/after-login-mobile-bg.jpg?v=1.8.8") center top / cover scroll no-repeat #f4eee6 !important;
  }
}

/* v1.8.32: independent tree add/profile update permissions and official platform mail sender. */
.landing-public-page .site-landing {
  align-items: center !important;
  background: linear-gradient(180deg, #eef6f4 0%, #f5efe8 67%, #f2ece5 100%) !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 0 clamp(16px, 3vw, 36px) 48px !important;
  position: relative !important;
  width: 100% !important;
}
.landing-public-page .site-landing::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(246, 240, 232, .06) 46%, rgba(246, 240, 232, .78) 100%),
    radial-gradient(circle at 50% 17%, rgba(255, 255, 255, .78), transparent 24%),
    url("/assets/after-login-desktop-bg.jpg?v=1.8.32") center 44% / cover no-repeat;
  content: "" !important;
  display: block !important;
  height: clamp(500px, 61vh, 650px) !important;
  inset: 0 0 auto !important;
  position: absolute !important;
  z-index: 0 !important;
}
.landing-public-page .site-landing::after {
  background: linear-gradient(180deg, transparent, rgba(242, 236, 229, .92) 78%, #f2ece5) !important;
  content: "" !important;
  display: block !important;
  height: 170px !important;
  inset: clamp(370px, 49vh, 540px) 0 auto !important;
  pointer-events: none !important;
  position: absolute !important;
  z-index: 0 !important;
}
.landing-public-page .landing-shield {
  display: flex !important;
}
.landing-public-page .landing-hero-content {
  align-items: center !important;
  display: flex !important;
  flex-direction: column !important;
  inset: auto !important;
  justify-content: flex-start !important;
  min-height: clamp(500px, 61vh, 650px) !important;
  padding-top: clamp(48px, 6.8vh, 80px) !important;
  position: relative !important;
  width: min(100%, 1120px) !important;
  z-index: 1 !important;
}
.landing-public-page .landing-ornament {
  display: inline-flex !important;
  margin-bottom: clamp(10px, 1.5vh, 16px) !important;
}
.landing-public-page .landing-hero-content h1 {
  color: var(--landing-deep) !important;
  display: block !important;
  font-size: clamp(50px, 5.3vw, 84px) !important;
  font-weight: 900 !important;
  line-height: 1.04 !important;
  margin: 0 0 12px !important;
  max-width: 100% !important;
  text-shadow: 0 2px 16px rgba(255, 255, 255, .55) !important;
}
.landing-public-page .landing-lineage,
.landing-public-page .landing-slogan,
.landing-public-page .landing-gold-rule {
  display: block !important;
}
.landing-public-page .landing-lineage {
  font-size: clamp(21px, 1.9vw, 31px) !important;
  line-height: 1.55 !important;
  margin: 0 !important;
  text-shadow: 0 2px 12px rgba(255, 255, 255, .55) !important;
}
.landing-public-page .landing-slogan {
  font-size: clamp(20px, 1.55vw, 28px) !important;
  line-height: 1.55 !important;
  margin-top: 14px !important;
}
.landing-public-page .landing-login-button {
  background: linear-gradient(180deg, #08535b, #043d44) !important;
  border: 1px solid rgba(184, 138, 58, .44) !important;
  box-shadow: 0 15px 28px rgba(4, 49, 54, .24) !important;
  height: auto !important;
  left: auto !important;
  min-height: 62px !important;
  min-width: clamp(240px, 21vw, 330px) !important;
  opacity: 1 !important;
  overflow: visible !important;
  padding: 14px 28px !important;
  position: static !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
}
.landing-public-page .landing-family-card {
  display: block !important;
  margin-top: -64px !important;
  padding-top: 78px !important;
}
.landing-public-page .landing-card-emblem {
  height: 96px !important;
  top: -48px !important;
  width: 96px !important;
}
.landing-public-page .landing-feature {
  min-height: 190px !important;
  padding-block: 4px 18px !important;
}
.landing-public-page .landing-feature-icon {
  border-radius: 14px !important;
  height: 54px !important;
  margin-bottom: 14px !important;
  width: 54px !important;
}
.landing-public-page .landing-feature-icon svg {
  height: 30px !important;
  width: 30px !important;
}
.landing-public-page .landing-feature h3 {
  font-size: clamp(18px, 1.35vw, 23px) !important;
}
.landing-public-page .landing-feature p {
  font-size: clamp(14px, 1vw, 17px) !important;
}
.home-icon {
  height: 28px !important;
  width: 28px !important;
}
.home-icon svg,
.service-grid svg {
  height: 24px !important;
  width: 24px !important;
}
.home-card {
  min-height: 116px !important;
  padding: 9px 8px !important;
}
@media (max-width: 767px) {
  .landing-public-page .site-landing {
    background: linear-gradient(180deg, #eef6f4 0%, #f5efe8 68%, #f2ece5 100%) !important;
    min-height: 100vh !important;
    padding-inline: 14px !important;
  }
  .landing-public-page .site-landing::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(246, 240, 232, .04) 48%, rgba(246, 240, 232, .86) 100%),
      radial-gradient(circle at 50% 16%, rgba(255, 255, 255, .72), transparent 26%),
      url("/assets/after-login-mobile-bg.jpg?v=1.8.32") center top / cover no-repeat;
    height: 54vh !important;
  }
  .landing-public-page .site-landing::after {
    inset: 42vh 0 auto !important;
  }
  .landing-public-page .landing-shield {
    height: 92px !important;
    right: 24px !important;
    width: 64px !important;
  }
  .landing-public-page .landing-hero-content {
    min-height: 54vh !important;
    padding-top: 54px !important;
  }
  .landing-public-page .landing-hero-content h1 {
    font-size: clamp(34px, 9vw, 52px) !important;
    line-height: 1.08 !important;
    max-width: 94% !important;
  }
  .landing-public-page .landing-lineage {
    font-size: clamp(17px, 4.7vw, 24px) !important;
  }
  .landing-public-page .landing-slogan {
    font-size: clamp(16px, 4.3vw, 22px) !important;
    margin-top: 10px !important;
  }
  .landing-public-page .landing-login-button {
    min-height: 54px !important;
    min-width: min(76vw, 280px) !important;
    padding: 12px 22px !important;
  }
  .landing-public-page .landing-family-card {
    margin-top: -42px !important;
    padding-top: 62px !important;
  }
  .landing-public-page .landing-card-emblem {
    height: 78px !important;
    top: -39px !important;
    width: 78px !important;
  }
  .landing-public-page .landing-feature {
    min-height: 164px !important;
  }
  .landing-public-page .landing-feature-icon {
    height: 48px !important;
    margin-bottom: 10px !important;
    width: 48px !important;
  }
  .landing-public-page .landing-feature-icon svg {
    height: 27px !important;
    width: 27px !important;
  }
}
body[data-authenticated="1"] {
  background: url("/assets/after-login-desktop-bg.jpg?v=1.8.32") center center / cover fixed no-repeat #f4eee6 !important;
}
.login-page {
  background: url("/assets/after-login-desktop-bg.jpg?v=1.8.32") center center / cover fixed no-repeat #f4eee6 !important;
}
@media (max-width: 767px) {
  body[data-authenticated="1"],
  .login-page {
    background: url("/assets/after-login-mobile-bg.jpg?v=1.8.32") center top / cover scroll no-repeat #f4eee6 !important;
  }
}

/* v1.8.31: centered admin screens and branch trash UI */
.centered-admin-panel,
.admin-panel,
.section-header,
.request-grid,
.admin-section {
  margin-inline: auto;
}

.trash-table td,
.trash-table th {
  text-align: center;
  vertical-align: middle;
}

.trash-actions {
  justify-content: center;
  gap: 8px;
}

.trash-actions form {
  margin: 0;
}

.person-modal-content .danger-button[data-admin-trash-branch] {
  background: linear-gradient(135deg, #3a1714, #9d231f) !important;
  color: #fff !important;
  border-color: rgba(157, 35, 31, .45) !important;
}
