/* crmanager pages - design A «لوح الرسم» (Drawing Board), DesignKit crmanager-pages, approved by Ali 2026-10-11.
   Drafting paper with a faint measuring grid, navy ink, safety orange only on the one thing to press.
   Phone first. Every text colour pair measured: WCAG AA 4.5:1 or better in both themes. */
:root {
  --ground: #f2f5f9; --surface: #ffffff; --ink: #10233d; --muted: #586579; --line: #d4dce7; --field: #ffffff; --field-line: #b9c5d4;
  --accent: #b8501a; --accent-ink: #ffffff; --chip-on: #10233d; --chip-on-ink: #ffffff; --tag-bg: #e6edf6; --tag-ink: #1d3a5f;
  --hero-bg: #10233d; --hero-ink: #ffffff; --hero-soft: #b8c6d8; --hero-line: #3a5170; --grid: rgba(16, 35, 61, .045); --grid-major: rgba(16, 35, 61, .065);
  --bar-bg: rgba(255, 255, 255, .94); --error: #b3261e; --error-bg: #fdecea; --ok: #1f6f43; --ok-bg: #e5f3ea; --wa: #1a7f47;
  --head: #ffffff;   /* Telegram's header over the bar (Mini App) */
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d1726; --surface: #13213a; --ink: #e8eef6; --muted: #a3b2c6; --line: #263955; --field: #0f1b2f; --field-line: #3a5070;
    --accent: #f08c50; --accent-ink: #10233d; --chip-on: #e8eef6; --chip-on-ink: #10233d; --tag-bg: #1d2f4b; --tag-ink: #cfdcec;
    --hero-bg: #091222; --hero-ink: #ffffff; --hero-soft: #a9bad0; --hero-line: #2c4262; --grid: rgba(232, 238, 246, .035); --grid-major: rgba(232, 238, 246, .05);
    --bar-bg: rgba(13, 23, 38, .94); --error: #ffb4ab; --error-bg: #3a1714; --ok: #8fd3a9; --ok-bg: #12301f; --wa: #6fd39a;
    color-scheme: dark;
    --head: #0d1726;
  }
}
/* inside Telegram the app's own light/dark choice wins (public/tg.js sets data-theme) */
:root[data-theme="dark"] {
  --ground: #0d1726; --surface: #13213a; --ink: #e8eef6; --muted: #a3b2c6; --line: #263955; --field: #0f1b2f; --field-line: #3a5070;
  --accent: #f08c50; --accent-ink: #10233d; --chip-on: #e8eef6; --chip-on-ink: #10233d; --tag-bg: #1d2f4b; --tag-ink: #cfdcec;
  --hero-bg: #091222; --hero-ink: #ffffff; --hero-soft: #a9bad0; --hero-line: #2c4262; --grid: rgba(232, 238, 246, .035); --grid-major: rgba(232, 238, 246, .05);
  --bar-bg: rgba(13, 23, 38, .94); --error: #ffb4ab; --error-bg: #3a1714; --ok: #8fd3a9; --ok-bg: #12301f; --wa: #6fd39a;
  color-scheme: dark;
  --head: #0d1726;
}
[data-app] .footnav { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--ground); font: 16px/1.75 var(--font);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px; background-attachment: fixed;
}
a { color: inherit; }
h1, h2, h3 { font-weight: 600; line-height: 1.45; text-wrap: balance; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* bar */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bar-bg); border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; backdrop-filter: saturate(1.2) blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; max-width: 1080px; margin: 0 auto; }
.mark { width: 36px; height: 36px; flex: none; border-radius: 6px; background: #10233d; color: #ffffff; display: grid; place-items: center; }
.mark svg { width: 21px; height: 21px; }
.brand b { display: block; font-size: 1rem; line-height: 1.3; }
.brand small { display: block; font-size: .78rem; line-height: 1.3; color: var(--muted); }

/* layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 14px; }
.wrap.wide { max-width: 1080px; }
.foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 22px); }

/* hero: the navy drawing sheet */
.hero { position: relative; overflow: hidden; border-radius: var(--r); padding: 20px 18px 34px; background-color: var(--hero-bg); color: var(--hero-ink);
  border: 1px solid var(--hero-line);
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 16px 16px; }
.hero h1 { font-size: 1.4rem; margin-bottom: 6px; }
.hero p { margin: 0; color: var(--hero-soft); font-size: .92rem; white-space: normal; max-width: 62ch; }
.hero::after { content: "مقياس ١:٥٠"; position: absolute; left: 14px; bottom: 10px; font-size: .68rem; color: var(--hero-soft);
  border-top: 1px solid var(--hero-soft); padding-top: 2px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; padding: 0; list-style: none; }
.steps a { display: block; text-decoration: none; font-size: .78rem; line-height: 1.4; color: var(--hero-soft); border-top: 3px solid var(--hero-line); padding-top: 7px; }
.steps a.on, .steps:not(:has(.on)) li:first-child a { color: var(--hero-ink); border-top-color: var(--accent); font-weight: 600; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--ink); border-radius: var(--r); padding: 16px; min-width: 0; }
.card > h2 { font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
.card > h2 .n { flex: none; min-width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: .78rem; background: var(--accent); color: var(--accent-ink); }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.section { scroll-margin-top: 76px; }

/* questions */
.q { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.q > label, .q > legend { font-weight: 600; font-size: .95rem; padding: 0; }
.q > legend { margin-bottom: 6px; }
.q .req { color: var(--accent); }
.q small { display: block; color: var(--muted); font-size: .8rem; margin-top: -4px; }
input[type=text], input[type=tel], input[type=email], input[type=url], input[type=search], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 11px 12px; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 14px; border: 1px solid var(--field-line); border-radius: 6px;
  background: var(--field); font-size: .92rem; line-height: 1.4; transition: background-color .2s, color .2s, border-color .2s; }
.chip input:checked + span { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.other-text { margin-top: 2px; }
.has-error > label, .has-error > legend { color: var(--error); }
.has-error input, .has-error .chip span { border-color: var(--error); }
details.terms { margin-top: 18px; border: 1px dashed var(--field-line); border-radius: 6px; padding: 10px 12px; background: var(--ground); }
details.terms summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
details.terms .desc { margin-top: 8px; font-size: .9rem; line-height: 1.9; color: var(--ink); }
.submit { position: sticky; bottom: 0; z-index: 4; margin: 0 -16px; padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: var(--bar-bg); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.btn { display: block; width: 100%; max-width: 688px; margin: 0 auto; font: 600 1.02rem var(--font); color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 6px; padding: 13px; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.error-summary { border-inline-start-color: var(--error); background: var(--error-bg); }
.error-summary h2 { font-size: 1rem; color: var(--error); }
.error-summary ul { margin: 6px 0 0; padding-inline-start: 20px; }
/* feedback form: a field people never see (bots fill it); clipped, not moved off-page (that scrolls sideways in RTL) */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }

/* notices (bad link, done, errors) */
.notice h1 { font-size: 1.25rem; margin-bottom: 6px; }
.notice p { margin: 0; color: var(--muted); }
.notice.ok { border-inline-start-color: var(--ok); text-align: center; padding: 28px 18px; }
.notice .tick { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.notice .tick svg { width: 30px; height: 30px; }

/* directory */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tools input { flex: 1 1 260px; min-width: 0; }
.count { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
.co { display: grid; gap: 8px; }
.co h2 { font-size: 1.05rem; }
.co .who { font-size: .88rem; color: var(--muted); margin-top: -4px; }
.co .who a { text-decoration: none; border-bottom: 1px dotted var(--muted); }
.co .phone { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; unicode-bidi: plaintext; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink); }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.acts a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 6px; border: 1px solid var(--line); background: var(--ground);
  font-size: .76rem; text-decoration: none; color: var(--ink); }
.acts a:hover { border-color: var(--ink); }
.acts svg { width: 19px; height: 19px; color: var(--accent); }
.acts a.wa svg { color: var(--wa); }
.empty { text-align: center; color: var(--muted); }

/* featured post */
.post { display: grid; gap: 12px; }
.author { display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--chip-on); color: var(--chip-on-ink); font-weight: 600; }
.author b { display: block; }
.author small { color: var(--muted); font-size: .8rem; }
.badge { justify-self: start; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink); }
.post .body { font-size: 1.04rem; line-height: 2; overflow-wrap: anywhere; }
.post .body p { margin: 0 0 12px; }

/* intro (front page) and terms */
.intro h1 { font-size: 1.7rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cta .btn { width: auto; margin: 0; padding: 11px 20px; text-decoration: none; }
.hero .note { margin-top: 12px; font-size: .82rem; line-height: 1.8; }
/* the WhatsApp group: WhatsApp's own green (#25D366) with its mark; dark green text (7.5:1) - white on that green would
   fail the contrast every pair here meets */
.cta .btn:has(svg) { display: inline-flex; align-items: center; gap: 8px; }
.cta .btn svg { width: 20px; height: 20px; flex: none; }
.cta .btn.wa-btn { background: #25D366; color: #052e16; border: 0; }
.cta .btn.wa-btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--hero-ink); border: 1px solid var(--hero-soft); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cols .card p, .join p { margin: 8px 0 0; }
.join .note { color: var(--muted); font-size: .92rem; }
.join .btn { display: inline-block; width: auto; text-decoration: none; padding: 11px 20px; }
.links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.links a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); text-decoration: none; }
.links a::before { content: "↖ "; color: var(--accent); }
.links a:hover { border-color: var(--ink); }
.terms-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; line-height: 1.9; }
.terms-list li.sub { padding-inline-start: 22px; color: var(--ink); }
.footnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 6px; }
.foot p { margin: 0; }

/* search pages */
/* search filters (src/SearchPages.php): folded under the search box in the hero */
.filterbox { margin-top: 12px; }
.filterbox summary { cursor: pointer; color: var(--hero-ink); font-weight: 600; font-size: .9rem; }
.filterbox summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 10px; }
.filter-grid label { display: grid; gap: 4px; font-size: .82rem; color: var(--hero-soft); min-width: 0; }
.filter-grid select { width: 100%; font: inherit; font-size: .9rem; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 9px 10px; }
.filter-grid select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-grid input[type=search] { padding: 9px 10px; font-size: .9rem; }
.filter-grid .check { display: flex; align-items: center; gap: 8px; color: var(--hero-ink); font-size: .9rem; grid-column: 1 / -1; }
.filter-grid .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 6px;
  background: var(--field); color: var(--ink); font-size: .9rem; min-width: 0; }
.chosen span { min-width: 0; overflow-wrap: anywhere; }
.chosen a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 0 4px; }
.filterbox .hint { margin: 10px 0 0; font-size: .8rem; }
/* «الزيارات» (AdminPanel::stats) */
.stat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card { display: grid; gap: 2px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat-card small { color: var(--muted); font-size: .8rem; }
.stat-card b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: .8rem; }
.chart { display: block; width: 100%; height: 140px; margin-top: 10px; }
.chart .w { fill: var(--ink); }
.chart .a { fill: var(--accent); }
.key { display: inline-flex; align-items: center; gap: 4px; }
.key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--ink); }
.key.a::before { background: var(--accent); }
.stat-grid { display: grid; gap: 14px; }
table.stat { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .88rem; }
table.stat th, table.stat td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: start; overflow-wrap: anywhere; }
table.stat th { color: var(--muted); font-weight: 600; font-size: .78rem; }
table.stat td:not(:first-child), table.stat th:not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.stat a { color: var(--accent); text-decoration: none; font-weight: 600; }
@media (min-width: 720px) { .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the «العضو» drop-down (public/search.js): members by number of posts */
.who-box { position: relative; }
.who-box input.picked { font-weight: 600; }   /* a member chosen from the list: applied when «بحث» is pressed */
.suggest { position: absolute; inset-inline: 0; top: 100%; z-index: 10; margin: 4px 0 0; padding: 4px 0; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--field-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.suggest li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: .9rem; }
.suggest li span { min-width: 0; overflow-wrap: anywhere; }
.suggest li small { flex: none; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--tag-bg); color: var(--tag-ink); }
.suggest li:hover small, .suggest li[aria-selected="true"] small { color: var(--tag-ink); }
.suggest li.none { cursor: default; color: var(--muted); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pick a { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; }
.pick a:hover { border-color: var(--ink); }
.pick small { color: var(--muted); font-size: .75rem; }
.thumb { display: block; max-width: 100%; max-height: 320px; margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--field); }
.contact-card { margin: 8px 0 0; overflow-wrap: anywhere; }
.contact-card a { color: var(--accent); font-weight: 600; text-decoration: none; }
@media (max-width: 360px) { .filter-grid { grid-template-columns: 1fr; } }
.searchbox { display: flex; gap: 8px; margin-top: 14px; }
.searchbox input { flex: 1; min-width: 0; }
.searchbox .btn { width: auto; margin: 0; padding: 11px 18px; }
.results { display: grid; gap: 12px; }
.result .excerpt, .post .body { margin: 8px 0 0; line-height: 1.9; overflow-wrap: anywhere; }
mark, .excerpt b { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; font-weight: 600; }
.result-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .88rem; }
.result-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.author .badge { margin-inline-start: auto; }
.parent { border-inline-start-color: var(--muted); opacity: .92; }
.parent .lbl { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.replies-title { font-size: 1rem; margin: 6px 0 -2px; }
.reply { margin-inline-start: 18px; }
.pager { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.pager a { color: var(--accent); font-weight: 600; text-decoration: none; }
.back { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Mini App home (src/AppHome.php): the member's status, then one tile per service */
.status { display: grid; gap: 4px; }
.status h2 { font-size: 1.08rem; }
.status p { margin: 0; color: var(--muted); font-size: .92rem; }
.status.ok { border-inline-start-color: var(--ok); }
.status.wait, .status.go { border-inline-start-color: var(--accent); }
.status.no { border-inline-start-color: var(--error); }
.status-action { margin-top: 10px; }
.status-action form { margin: 0; }
.status-action .btn { text-decoration: none; text-align: center; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-form { margin: 0; display: grid; }
.tile { display: grid; align-content: start; gap: 2px; min-height: 116px; width: 100%; padding: 14px; text-align: start; text-decoration: none;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font: inherit; cursor: pointer; }
.tile:hover { border-color: var(--ink); }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tile .ti { width: 34px; height: 34px; margin-bottom: 6px; border-radius: 8px; display: grid; place-items: center; background: var(--tag-bg); color: var(--tag-ink); }
.tile .ti svg { width: 20px; height: 20px; }
.tile b { font-size: .98rem; line-height: 1.5; }
.tile small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
/* top-20 lists */
.top { margin: 0; padding: 0; list-style: none; display: grid; }
.top li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.top li:last-child { border-bottom: 0; }
.top .rank { flex: none; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--tag-bg); color: var(--tag-ink);
  font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.top li:nth-child(-n+3) .rank { background: var(--ink); color: var(--surface); }
.top .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.top .n { font-variant-numeric: tabular-nums; }
.switch { margin: 0; text-align: center; }
.switch a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* admin panel (src/AdminPanel.php) */
.tabs, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a, .filters a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.filters a { font-weight: 400; font-size: .85rem; padding: 6px 12px; }
.tabs a.on, .filters a.on { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.count-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.flash { margin: 0; padding: 10px 14px; border-radius: var(--r); background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: .9rem; }
.fresh { margin: 0; text-align: center; }
.fresh a { display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.post .author { flex-wrap: wrap; gap: 4px 10px; }
.post .author time { margin-inline-start: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge.warned { background: var(--error-bg); color: var(--error); }
.badge.deleted { background: var(--error-bg); color: var(--error); }
.badge.featured, .badge.liked, .badge.reviewed { background: var(--ok-bg); color: var(--ok); }
.kind { margin: 0; font-size: .82rem; color: var(--muted); }
.kind::before { content: "📎 "; }
.kind.plain::before { content: none; }   /* a line of details, not a file */
.post .body { margin: 0; line-height: 1.9; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
.actions button { font: 600 .85rem var(--font); padding: 7px 12px; min-height: 38px; border-radius: 6px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--field-line); }
.actions button:hover { border-color: var(--ink); }
.actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions button:disabled { opacity: .5; cursor: default; }
.threads { display: grid; gap: 8px; }
.thread-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-decoration: none; color: var(--ink); }
.thread-row small { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.thread-row time { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.thread-row .badge { justify-self: start; }
.member h2 { font-size: 1.08rem; }
.warn-note { margin: 0; padding: 10px 14px; border-radius: var(--r); background: var(--error-bg); color: var(--error); font-size: .9rem; }
.dm { display: grid; gap: 8px; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.bubble p { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.bubble small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.bubble.in { justify-self: start; border-start-start-radius: 2px; }
.bubble.out { justify-self: end; border-start-end-radius: 2px; background: var(--tag-bg); color: var(--tag-ink); border-color: transparent; }
.bubble.out small { color: var(--tag-ink); }
.who { color: var(--ink); font-weight: 600; text-decoration: none; }
.who:hover { text-decoration: underline; }
.facts { margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.facts div { min-width: 0; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.section-title { font-size: 1rem; margin: 6px 0 -4px; }
.log { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: .88rem; }
.link-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--field-line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .85rem; }
.link-btn:hover { border-color: var(--ink); }
.media { display: block; max-width: 100%; max-height: 420px; border-radius: 6px; border: 1px solid var(--line); background: var(--field); }
audio.media { width: 100%; max-height: none; border: 0; background: transparent; }
.reply { display: grid; gap: 8px; }
.reply label { font-weight: 600; font-size: .92rem; }
.reply textarea { min-height: 110px; resize: vertical; }

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 26px 24px 36px; }
  .hero h1 { font-size: 1.6rem; }
  .card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* the admin panel's «الأعضاء» and member pages: the text cannot be selected or copied (Ali 2026-10-12), admin.js blocks copying too */
.no-copy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input, .no-copy textarea { -webkit-user-select: text; user-select: text; }
.member-search { display: grid; gap: 6px; }
.member-search label { font-size: .85rem; color: var(--muted); }
.member-search .row { display: flex; gap: 8px; }
.member-search input { flex: 1; min-width: 0; }
.member-search .row .btn { width: auto; margin: 0; padding: 11px 18px; flex: 0 0 auto; }   /* not the site's full-width button (it squeezed the box, Ali 2026-10-12) */
.filters.sort { align-items: center; }
details.form-version summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
