:root {
  --navy: #00303f;
  --teal: #458078;
  --maroon: #7a2052;
  --sand: #e2d9d6;

  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f3efec;
  --text: #14262d;
  --muted: #55666c;
  --line: #e4ddd9;
  --accent: #00303f;
  --accent-text: #ffffff;
  --link: #2f6b63;
  --highlight: #7a2052;
  --logo-panel: transparent;
  --shadow: 0 1px 2px rgba(0, 48, 63, .06), 0 8px 24px rgba(0, 48, 63, .06);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1a20;
    --surface: #112830;
    --surface-2: #0e2027;
    --text: #e9eff0;
    --muted: #a3b4b8;
    --line: #213a43;
    --accent: #7fc3b7;
    --accent-text: #08242b;
    --link: #8fd0c4;
    --highlight: #e08ab4;
    --logo-panel: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1a20;
  --surface: #112830;
  --surface-2: #0e2027;
  --text: #e9eff0;
  --muted: #a3b4b8;
  --line: #213a43;
  --accent: #7fc3b7;
  --accent-text: #08242b;
  --link: #8fd0c4;
  --highlight: #e08ab4;
  --logo-panel: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: block; background: var(--logo-panel); border-radius: 10px; padding: 4px 8px; }
.brand img { height: 46px; width: auto; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--text); text-decoration: none; white-space: nowrap; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 16px; }
.nav a:hover { background: var(--surface-2); }
.tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); height: 40px; min-width: 40px; padding: 0 12px; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { border-color: var(--teal); }
.menu-btn { display: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 17px; text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.3; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { border-color: var(--accent); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 18px; font-size: 15px; }

/* hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); background:
  radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--teal) 18%, transparent), transparent 70%),
  radial-gradient(700px 350px at 5% 110%, color-mix(in srgb, var(--maroon) 12%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.eyebrow { display: inline-block; color: var(--highlight); font-weight: 600; font-size: 15px; letter-spacing: .02em; margin-bottom: 12px; }
h1 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.3; margin: 0 0 18px; font-weight: 700; letter-spacing: -.01em; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 40em; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.mark { position: relative; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr 1fr; gap: 10px; }
.mark i { display: block; }
.mark .b1 { background: var(--navy); grid-column: 1; grid-row: 1 / 5; border-start-start-radius: 44px; border-end-start-radius: 44px; }
.mark .b2 { background: var(--teal); grid-column: 2 / 5; grid-row: 1; }
.mark .b3 { background: var(--maroon); grid-column: 4; grid-row: 2 / 4; border-end-end-radius: 0; }
.mark .b4 { background: var(--sand); grid-column: 2 / 4; grid-row: 4; border-end-end-radius: 44px; }
.mark .b5 { background: var(--surface); grid-column: 2 / 4; grid-row: 2 / 4; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; text-align: center; padding: 8px; box-shadow: var(--shadow); }
.mark .b5 strong { display: block; font-size: clamp(34px, 6vw, 56px); line-height: 1; color: var(--highlight); }
.mark .b5 span { font-size: 14px; color: var(--muted); line-height: 1.4; display: block; margin-top: 6px; }
:root[data-theme="dark"] .mark .b1 { background: #0a3f52; }

/* sections */
section { padding: clamp(48px, 6vw, 88px) 0; }
.alt { background: var(--surface-2); }
.sec-head { max-width: 46em; margin-bottom: 36px; }
h2 { font-size: clamp(25px, 3vw, 36px); line-height: 1.35; margin: 0 0 12px; letter-spacing: -.01em; }
.sec-head p { color: var(--muted); margin: 0; }
.ph-note { display: inline-block; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--maroon) 14%, transparent); color: var(--highlight); padding: 2px 10px; border-radius: 99px; margin-inline-start: 8px; vertical-align: middle; letter-spacing: .02em; }

.stats { border-block: 1px solid var(--line); background: var(--surface); padding: 28px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 16px; text-align: center; }
.stat strong { display: block; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 15px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.about-grid p { margin: 0 0 16px; color: var(--muted); }
.pillars { display: grid; gap: 14px; }
.pillar { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.pillar svg { flex: none; width: 40px; height: 40px; color: var(--teal); }
.pillar h3 { margin: 0 0 2px; font-size: 19px; }
.pillar p { margin: 0; font-size: 15.5px; color: var(--muted); line-height: 1.6; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
.card p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.card .more { margin-top: auto; font-weight: 600; text-decoration: none; }
.card .more:hover { text-decoration: underline; }
.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; background: var(--navy); color: #fff; border-color: transparent; align-items: center; }
:root[data-theme="dark"] .feature { background: #0a3f52; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feature { background: #0a3f52; } }
.feature h3 { font-size: clamp(22px, 2.6vw, 30px); color: #fff; }
.feature p { color: #cfe1e3; }
.feature .btn-primary { background: #fff; color: var(--navy); }
.feature .btn-ghost { border-color: #fff; color: #fff; }
.feature .btn-ghost:hover { background: rgba(255,255,255,.12); }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px 14px; font-size: 16px; line-height: 1.5; }
.feature-list b { color: #9ee0d3; }
.kind { font-size: 13px; font-weight: 600; color: var(--highlight); margin-bottom: 6px; }

.join { background: linear-gradient(135deg, var(--navy), #0a4a5e); color: #fff; border-radius: 22px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
:root[data-theme="dark"] .join { background: linear-gradient(135deg, #0a3f52, #0b5a56); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .join { background: linear-gradient(135deg, #0a3f52, #0b5a56); } }
.join h2 { color: #fff; }
.join p { color: #cfe1e3; margin: 0 0 22px; }
.join .btn-primary { background: #fff; color: var(--navy); }
.perks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.perks li { background: rgba(255,255,255,.1); border-radius: 12px; padding: 14px; font-size: 16px; line-height: 1.5; }
.perks svg { width: 26px; height: 26px; color: #9ee0d3; margin-bottom: 6px; display: block; }

.countries { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 8px 18px; font-weight: 500; }
.chip b { color: var(--accent); font-variant-numeric: tabular-nums; }

.quote { position: relative; }
.quote blockquote { margin: 0 0 16px; font-size: 18px; line-height: 1.7; }
.quote blockquote::before { content: "\201C"; display: block; font-size: 52px; line-height: .8; color: var(--teal); font-family: Georgia, serif; }
.who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--sand); color: var(--navy); display: grid; place-items: center; font-weight: 700; }
.who small { display: block; color: var(--muted); line-height: 1.4; }

.article { padding: 0; overflow: hidden; }
.article .cover { aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--teal), var(--navy)); }
.article:nth-child(2) .cover { background: linear-gradient(135deg, var(--maroon), var(--navy)); }
.article:nth-child(3) .cover { background: linear-gradient(135deg, var(--navy), var(--teal)); }
.article .body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.meta { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.article h3 a { color: inherit; text-decoration: none; }
.article h3 a:hover { text-decoration: underline; }

.partners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.partner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 92px; display: grid; place-items: center; padding: 14px; text-align: center; font-weight: 600; color: var(--muted); }
.partner.dashed { border-style: dashed; font-weight: 400; font-size: 14px; }
.partner img { background: #fff; border-radius: 8px; padding: 6px 10px; max-height: 56px; width: auto; }

.contact { text-align: center; }
.contact .sec-head { margin-inline: auto; }
.contact .cta { justify-content: center; }
.socials { display: flex; justify-content: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.socials a { color: var(--text); text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 16px; font-size: 15px; font-weight: 500; }
.socials a:hover { border-color: var(--teal); }

footer { background: var(--navy); color: #b9ced1; padding: 36px 0; font-size: 15px; }
:root[data-theme="dark"] footer { background: #071419; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) footer { background: #071419; } }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
footer a { color: #fff; }

/* responsive */
@media (max-width: 1100px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .tools { margin-inline-start: auto; }
}
@media (max-width: 960px) {
  .hero-grid, .about-grid, .join, .feature { grid-template-columns: 1fr; }
  .mark { max-width: 340px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .partners { grid-template-columns: 1fr 1fr; }
  .tools .btn { display: none; }
}
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .cards { grid-template-columns: 1fr; }
  .perks { grid-template-columns: 1fr; }
  .brand img { height: 36px; }
  .bar { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- inner pages ---------- */
a.icon-btn { text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--link); }
.muted { color: var(--muted); }
.after { margin-top: 28px; }
h2.h3 { font-size: 22px; margin: 0 0 8px; }

.page-hero { padding: clamp(36px, 5vw, 72px) 0 clamp(20px, 3vw, 40px); background:
  radial-gradient(800px 300px at 90% -20%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 14px; }
.page-hero .lead { margin-bottom: 0; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-inline-start: 30px; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 14px; height: 14px; border-radius: 4px; background: var(--teal); }
.steps { margin: 0 0 20px; padding-inline-start: 22px; display: grid; gap: 10px; }
.steps li::marker { color: var(--highlight); font-weight: 700; }

.message { max-width: 52em; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 5vw, 48px); box-shadow: var(--shadow); }
.message h2 { font-size: 15px; color: var(--highlight); margin-bottom: 6px; letter-spacing: .02em; }
.message h3 { font-size: clamp(22px, 3vw, 30px); line-height: 1.4; margin: 0 0 18px; }
.prose p { margin: 0 0 16px; color: var(--text); }
.signature { margin: 24px 0 0; border-top: 1px solid var(--line); padding-top: 16px; }
.signature span { color: var(--muted); font-size: 15px; }

.notice { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--muted); margin: 0; }
.icon-card svg { width: 36px; height: 36px; color: var(--teal); margin-bottom: 10px; }
.join.slim { grid-template-columns: 1fr; }
.link-card { text-decoration: none; color: var(--text); transition: border-color .15s; }
.link-card:hover { border-color: var(--teal); }
.link-card strong { font-size: 18px; overflow-wrap: break-word; }
.person { align-items: flex-start; }
.person img, .avatar.lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; }
.avatar.lg { font-size: 34px; }
img.avatar { object-fit: cover; }

/* AIAP schedule */
.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.week summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 16px 20px; font-weight: 700; font-size: 18px; }
.week summary::-webkit-details-marker { display: none; }
.week summary::after { content: "+"; margin-inline-start: auto; font-size: 24px; color: var(--link); line-height: 1; }
.week[open] summary::after { content: "\2212"; }
.week summary small { color: var(--muted); font-weight: 400; font-size: 14px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.schedule { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.schedule th { text-align: start; background: var(--surface-2); padding: 10px 14px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.schedule td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.schedule small { color: var(--muted); }
.schedule .nowrap { white-space: nowrap; }
.badge { display: inline-block; background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--link); padding: 2px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.watch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.watch:hover { text-decoration: underline; }
.watch svg { width: 20px; height: 20px; }

@media (max-width: 960px) {
  .two { grid-template-columns: 1fr; }
  .cards.four { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .schedule thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .schedule, .schedule tbody, .schedule tr, .schedule td { display: block; width: 100%; }
  .schedule tr { padding: 14px 16px; border-top: 1px solid var(--line); }
  .schedule tr:first-child { border-top: 0; }
  .schedule td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .schedule td::before { content: attr(data-label); flex: 0 0 5.5em; color: var(--muted); font-size: 14px; }
  .schedule td br { display: none; }
}
@media (max-width: 620px) {
  .cards.four { grid-template-columns: 1fr; }
}

/* ---------- forms, account, admin ---------- */
.narrow { max-width: 760px; }
.small { font-size: 14.5px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); margin-bottom: 20px; }
.success-panel { border-color: var(--teal); }
.form .grid-2, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 16px; display: block; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15.5px; }
.field .req { color: var(--highlight); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=url], .field input[type=search],
.field select, .field textarea, .links-table input, .search input {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); line-height: 1.4; }
.field input[type=file] { font: inherit; font-size: 15px; max-width: 100%; }
.field input[type=color] { height: 44px; width: 80px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.field input:focus, .field select:focus, .field textarea:focus, .links-table input:focus { outline: 3px solid color-mix(in srgb, var(--teal) 55%, transparent); outline-offset: 0; border-color: var(--teal); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--highlight); }
.hint-line { margin: -6px 0 16px; color: var(--muted); font-size: 14px; }
.field .hint { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.field .err, .err { display: block; color: var(--highlight); font-size: 14.5px; margin-top: 4px; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.6; }
.check input { margin-top: .45em; width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flashes { margin-top: 16px; }
.flash { margin: 0 0 10px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.flash-success { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, var(--surface)); }
.flash-error { border-color: var(--highlight); background: color-mix(in srgb, var(--maroon) 12%, var(--surface)); }
.flash-info { border-color: var(--line); }

.nav-auth { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: 6px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.nav-auth form { margin: 0; }
.linklike { white-space: nowrap; background: none; border: 0; font: inherit; font-weight: 500; font-size: 16px; color: var(--text); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.linklike:hover { background: var(--surface-2); }

.member-card { text-align: center; }
.member-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--sand); }
.facts { display: grid; grid-template-columns: minmax(7em, 14em) minmax(0, 1fr); gap: 8px 18px; text-align: start; margin: 12px 0 0; }
.facts dt { color: var(--muted); font-size: 14.5px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dt { margin-top: 14px; }
  .facts dt:first-child { margin-top: 0; }
}
.badge[style*="--c"] { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); border: 1px solid var(--c); }
.st-pending { background: color-mix(in srgb, #c98a00 20%, transparent); color: var(--text); }
.st-active { background: color-mix(in srgb, var(--teal) 22%, transparent); }
.st-suspended, .st-rejected { background: color-mix(in srgb, var(--maroon) 18%, transparent); color: var(--text); }

.admin-tabs { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-tabs .wrap { display: flex; gap: 4px; overflow-x: auto; padding-block: 6px; }
.admin-tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 15.5px; }
.admin-tabs a:hover { background: var(--surface-2); }
.admin-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
a.chip { text-decoration: none; color: inherit; font-size: 15px; padding: 6px 14px; }
.chip b { color: inherit; }
.search { margin-inline-start: auto; min-width: 220px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.big { font-size: 36px; line-height: 1.1; color: var(--accent); display: block; }
.stack { display: grid; gap: 12px; }
.type-row { padding-bottom: 8px; }
.msg { padding: 0 20px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.links-table input { min-width: 260px; padding: 8px 10px; font-size: 14.5px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; margin: 0; border-top: 1px solid var(--line); }
.legal h2 { margin-top: 28px; }
.legal p { color: var(--text); }

@media (max-width: 760px) {
  .form .grid-2, .grid-2 { grid-template-columns: 1fr; }
  .search { margin-inline-start: 0; width: 100%; }
  .links-table input { min-width: 0; }
  .nav-auth { margin: 0; padding: 0; border: 0; flex-direction: column; align-items: stretch; }
}
@media (min-width: 1101px) {
  .nav-auth form { display: inline; }
}

/* ---------- certificates, verify, directory ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.cert-row { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.cert-row:first-of-type { border-top: 0; }
.cert-row.is-revoked { opacity: .7; }
.cert-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.cert-actions input[type=text] { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); width: 150px; }
.pick-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 8px; margin-bottom: 14px; }
.pick-list .check[hidden] { display: none; }
.sig-preview { display: block; max-height: 56px; width: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin-bottom: 8px; }
.verify { text-align: center; }
.verify .verdict { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; margin: 0 0 14px; }
.verify .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); }
.verify.is-invalid .dot { background: var(--highlight); }
.verify.is-valid { border-color: var(--teal); }
.verify.is-invalid { border-color: var(--highlight); }
.thumb { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.person.link-card { align-items: flex-start; gap: 4px; }
.filters select { font: inherit; font-size: 16px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
@media (max-width: 760px) { .cert-row { flex-direction: column; } .cert-actions { justify-content: flex-start; } }

/* ---------- member ID card (drawn on a canvas, exported as PNG) ---------- */
.card-stage { max-width: 1050px; margin-bottom: 8px; box-shadow: var(--shadow); border-radius: 6px; overflow: hidden; background: #7c0556; line-height: 0; }
.card-stage canvas { width: 100%; height: auto; display: block; }

/* ---------- account pages ---------- */
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; margin-inline-start: 4px; }
.admin-tabs a[aria-current="page"] .count { background: var(--accent-text); color: var(--accent); }
.cta.center { justify-content: center; }
.cert-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.cert-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.panel .cert-item { background: var(--bg); }
.cert-item.is-revoked { opacity: .65; }
.cert-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-info strong { overflow-wrap: anywhere; }
.cert-more { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; }
.cert-more summary { cursor: pointer; color: var(--link); font-size: 15px; font-weight: 500; }
.cert-more .copy-row, .cert-more form { margin-top: 10px; }
.panel details.cert-more { border-top: 0; padding-top: 0; }
@media (max-width: 620px) { .cert-item { grid-template-columns: 1fr; } .cert-item .cert-actions { justify-content: flex-start; } }
.cert-info small span { white-space: nowrap; }

/* ---------- articles: editor and body ---------- */
.editor-wrap { background: #fff; color: #14262d; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid #e4ddd9; background: #f6f4f2; }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 18px; }
.editor-wrap .ql-editor { min-height: 360px; line-height: 1.9; }
.editor-wrap .ql-editor img { max-width: 100%; height: auto; }
.editor-wrap .ql-editor.ql-blank::before { font-style: normal; color: #8a979b; }
.cover-preview { display: block; max-width: 320px; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.badge.art-draft { background: color-mix(in srgb, var(--muted) 20%, transparent); color: var(--text); }
.badge.art-submitted { background: color-mix(in srgb, #c98a00 22%, transparent); color: var(--text); }
.badge.art-changes_requested, .badge.art-rejected, .badge.art-hidden { background: color-mix(in srgb, var(--maroon) 18%, transparent); color: var(--text); }
.badge.art-published, .badge.art-approved { background: color-mix(in srgb, var(--teal) 24%, transparent); color: var(--text); }
.reviewer-note { color: var(--highlight); }
.prose.article-body { font-size: 19px; line-height: 2; }
.prose.article-body h2 { font-size: 28px; margin: 1.6em 0 .5em; }
.prose.article-body h3 { font-size: 23px; margin: 1.4em 0 .4em; }
.prose.article-body img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.2em auto; }
.prose.article-body blockquote { margin: 1.4em 0; padding: .4em 1.2em; border-inline-start: 4px solid var(--teal); color: var(--muted); }
.prose.article-body a { color: var(--link); }
.prose.article-body ul, .prose.article-body ol { padding-inline-start: 1.6em; }
.ql-align-center { text-align: center; } .ql-align-right { text-align: right; } .ql-align-left { text-align: left; } .ql-align-justify { text-align: justify; }
.ql-direction-rtl { direction: rtl; } .ql-indent-1 { padding-inline-start: 3em; } .ql-indent-2 { padding-inline-start: 6em; }

/* ---------- articles: public pages ---------- */
.article.card { padding: 0; overflow: hidden; }
.article .cover { display: block; aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--teal), var(--navy)); }
.article .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article .excerpt { margin: 0 0 12px; color: var(--muted); font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tag { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14.5px; }
.tag:hover, .tag.on { border-color: var(--teal); }
.article-meta { margin: 0; }
.article-cover { width: 100%; height: auto; border-radius: 14px; margin: 8px 0 24px; display: block; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 28px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.share a.chip { text-decoration: none; color: inherit; font-size: 15px; padding: 5px 14px; cursor: pointer; }
.share button.chip { font: inherit; font-size: 15px; padding: 5px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.author-box { margin-top: 28px; }
.author-head { display: flex; gap: 20px; align-items: center; }
.author-head h1 { margin: 0 0 6px; }
@media (max-width: 620px) { .author-head { flex-direction: column; align-items: flex-start; } }

/* Quill 1.x list markers in a right-to-left editor */
.editor-wrap .ql-editor[dir="rtl"] ol, .editor-wrap .ql-editor[dir="rtl"] ul { padding-left: 0; padding-right: 0; }
.editor-wrap .ql-editor[dir="rtl"] li { padding-left: 0; padding-right: 1.5em; }
.editor-wrap .ql-editor[dir="rtl"] li::before { margin-left: .3em; margin-right: -1.5em; text-align: left; }

/* ---------- articles list: compact header and one filter bar ---------- */
.page-hero.compact { padding: clamp(22px, 3vw, 36px) 0 clamp(12px, 2vw, 20px); }
.page-hero.compact h1 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 6px; }
.page-hero.compact .lead { font-size: 17px; margin: 0; }
section.tight { padding-top: clamp(20px, 2.5vw, 30px); }
.articles-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.articles-bar .filters { margin: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.articles-bar .filters .chip { flex: none; white-space: nowrap; }
.articles-bar > .btn { flex: none; }
@media (max-width: 760px) { .articles-bar { flex-direction: column; align-items: stretch; } .articles-bar > .btn { align-self: flex-start; } }

.article.no-cover { border-top: 4px solid var(--teal); }
.article.no-cover .body { padding-top: 22px; }
.article.card { height: 100%; }
.article .body .meta { margin-top: auto; padding-top: 6px; }

/* ---------- admin: two-level menu ---------- */
.admin-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-groups, .admin-sub { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 8px; }
.admin-groups a { padding: 8px 18px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 16px; }
.admin-groups a:hover { background: var(--surface-2); }
.admin-groups a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.admin-sub { background: var(--surface-2); margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); border-top: 1px solid var(--line); gap: 4px; }
.admin-sub a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.admin-sub a:hover { color: var(--text); background: var(--surface); }
.admin-sub a[aria-current="page"] { color: var(--link); background: var(--surface); box-shadow: inset 0 -2px 0 var(--teal); }

/* ---------- admin: compact lists (authors, categories) ---------- */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.admin-toolbar input[type=search] { flex: 1; min-width: 220px; max-width: 420px; font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.admin-row, .new-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.new-item { margin: 0 0 18px; }
.admin-row summary, .new-item summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 18px; }
.admin-row summary::-webkit-details-marker, .new-item summary::-webkit-details-marker { display: none; }
.admin-row summary::after { content: "+"; margin-inline-start: auto; font-size: 22px; color: var(--link); line-height: 1; }
.admin-row[open] summary::after { content: "\2212"; }
.admin-row .r-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.admin-row .r-name small { color: var(--muted); font-weight: 400; margin-inline-start: 8px; }
.admin-row .r-meta { color: var(--muted); font-size: 14.5px; }
.admin-row[open] summary, .new-item[open] summary { border-bottom: 1px solid var(--line); }
.admin-row form, .new-item form { padding: 16px 18px 6px; margin: 0; }
.admin-row[hidden] { display: none; }

.health-sum { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15.5px; }
.health-list li { display: flex; gap: 12px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; align-items: baseline; }
.health-list b { flex: none; width: 3.6em; font-size: 12.5px; letter-spacing: .04em; }
.health-list small { color: var(--muted); margin-inline-start: 6px; }
.health-ok b { color: var(--link); } .health-warn { border-color: #c98a00; } .health-warn b { color: #c98a00; } .health-fail { border-color: var(--highlight); } .health-fail b { color: var(--highlight); }

/* member map */
.member-map { position: relative; max-width: 960px; margin-inline: auto; }
.member-map canvas { width: 100%; display: block; }
.map-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 3px 10px; font-size: 14px; transform: translate(-50%, -130%); white-space: nowrap; }
.chips { list-style: none; margin: 18px auto 0; padding: 0; max-width: 960px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 2px 14px; font-size: 14px; color: var(--muted); }
.chips li b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* touch targets: at least 44px tall on phones, without changing how the page looks */
@media (max-width: 760px) {
  footer a { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
  footer .row { gap: 4px 20px; }
  a.chip, .filters .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .watch { min-height: 44px; padding-inline: 4px; }
  .schedule small, .who small { font-size: 13.5px; }
  .btn-sm { min-height: 44px; }
  .socials a { display: inline-flex; align-items: center; min-height: 44px; }
}
