/* Base styles of the public site and the dashboard. Colors come from css/tokens.css; component styles are isolated
   (*.razor.css). No inline styles anywhere: the Content-Security-Policy allows only same-origin stylesheets. */

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

html {
  font-family: var(--mb-font-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--mb-page);
  color: var(--mb-ink);
  font-size: 15px;
}

h1, h2, h3 {
  font-family: var(--mb-font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

h1:focus {
  outline: none;
}

p {
  margin: 0;
}

a {
  color: var(--mb-link);
}

a:hover {
  color: var(--mb-link-hover);
}

/* Keyboard focus is always visible (WCAG 2.4.7/2.4.11). */
:focus-visible {
  outline: 3px solid var(--mb-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--mb-radius);
  background: var(--mb-forest);
  color: var(--mb-on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--mb-on-accent);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Numbers, codes and URLs keep their own direction inside RTL text. */
.ltr, bdi.num, .num {
  direction: ltr;
  unicode-bidi: isolate;
}

.num {
  font-variant-numeric: tabular-nums;
}

code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--mb-touch);
  padding: 0 18px;
  border-radius: var(--mb-radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--mb-forest);
  color: var(--mb-on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--mb-forest-deep);
  color: var(--mb-on-accent);
}

.btn-secondary {
  background: var(--mb-card);
  color: var(--mb-link);
  border-color: var(--mb-forest);
}

.btn-quiet {
  background: var(--mb-card);
  color: var(--mb-ink);
  border-color: var(--mb-input-border);
}

.btn-danger {
  background: var(--mb-card);
  color: var(--mb-danger);
  border-color: var(--mb-danger);
}

.btn-link {
  min-height: var(--mb-touch);
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--mb-link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 52px;
  border-radius: 26px;
  font-size: 16px;
}

/* ----- Forms ----- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.field > label, .field-label {
  font-weight: 600;
}

.field-hint {
  font-size: 13px;
  color: var(--mb-muted);
}

.field-error {
  font-size: 13px;
  color: var(--mb-danger);
  font-weight: 600;
}

.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  min-height: var(--mb-touch);
  width: 100%;
  padding: 0 12px;
  border-radius: var(--mb-radius);
  border: 1px solid var(--mb-input-border);
  background: var(--mb-card);
  color: var(--mb-ink);
  font-family: inherit;
  font-size: 15px;
}

.field textarea {
  padding: 10px 12px;
  min-height: 96px;
  resize: vertical;
}

.field input[aria-invalid="true"], .field select[aria-invalid="true"], .input[aria-invalid="true"] {
  border-color: var(--mb-danger);
  border-width: 2px;
}

.field input:disabled, .input:disabled {
  background: var(--mb-card-muted);
  color: var(--mb-muted);
  border-color: var(--mb-border-strong);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--mb-touch);
  font-weight: 600;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--mb-forest);
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

fieldset {
  border: 1px solid var(--mb-border);
  border-radius: var(--mb-radius-lg);
  padding: 16px;
  margin: 0;
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

/* ----- Cards, sections, tables ----- */
.card {
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  border-radius: var(--mb-radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--mb-muted);
}

.small {
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.spacer {
  flex-grow: 1;
}

.note {
  padding: 12px 14px;
  border-radius: var(--mb-radius);
  background: var(--mb-card-muted);
  color: var(--mb-ink-strong);
  font-size: 13px;
  line-height: 1.7;
}

.table-wrap {
  /* Positioned so absolutely positioned descendants (.visually-hidden headers) are clipped by the scroll area
     instead of widening the whole page in RTL. */
  position: relative;
  width: 100%;
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th, table.data td {
  padding: 12px 14px;
  text-align: start;
  font-size: 14px;
  border-bottom: 1px solid var(--mb-border);
  vertical-align: middle;
}

table.data th {
  font-weight: 600;
  color: var(--mb-ink-strong);
  background: var(--mb-table-head);
}

table.data td.total {
  font-weight: 700;
}

/* ----- Chips (status never by color alone: always a text label) ----- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.chip-fundraising { background: var(--mb-chip-fundraising-bg); color: var(--mb-chip-fundraising-fg); }
.chip-active { background: var(--mb-chip-active-bg); color: var(--mb-chip-active-fg); }
.chip-planting { background: var(--mb-chip-planting-bg); color: var(--mb-chip-planting-fg); }
.chip-maintenance { background: var(--mb-chip-maintenance-bg); color: var(--mb-chip-maintenance-fg); }
.chip-completed { background: var(--mb-chip-completed-bg); color: var(--mb-chip-completed-fg); }
.chip-suspended { background: var(--mb-chip-suspended-bg); color: var(--mb-chip-suspended-fg); }
.chip-draft { background: var(--mb-chip-draft-bg); color: var(--mb-chip-draft-fg); }
.chip-danger { background: var(--mb-chip-danger-bg); color: var(--mb-chip-danger-fg); }
.chip-mine { background: var(--mb-chip-mine-bg); color: var(--mb-chip-mine-fg); }

/* ----- Alerts ----- */
.alert {
  padding: 12px 14px;
  border-radius: var(--mb-radius);
  font-size: 14px;
  line-height: 1.6;
}

.alert-error { background: var(--mb-danger-bg); color: var(--mb-danger); font-weight: 600; }
.alert-warning { background: var(--mb-warning-bg); color: var(--mb-warning-fg); }
.alert-success { background: var(--mb-success-bg); color: var(--mb-success-fg); }
.alert-info { background: var(--mb-info-bg); color: var(--mb-info-fg); }

.alert ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
}

/* ----- Tabs ----- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--mb-border-strong);
  overflow-x: auto;
}

.tab {
  min-height: var(--mb-touch);
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--mb-muted);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--mb-forest);
  color: var(--mb-ink);
  font-weight: 700;
}

/* ----- Progress ----- */
progress.bar {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 5px;
  background: var(--mb-border);
  accent-color: var(--mb-forest);
  appearance: none;
}

progress.bar::-webkit-progress-bar {
  background: var(--mb-border);
  border-radius: 5px;
}

progress.bar::-webkit-progress-value {
  background: var(--mb-forest);
  border-radius: 5px;
}

progress.bar::-moz-progress-bar {
  background: var(--mb-forest);
  border-radius: 5px;
}

/* ----- Modal dialog ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 13, 12, 0.55);
}

.modal {
  width: min(440px, 100%);
  background: var(--mb-card);
  color: var(--mb-ink);
  border-radius: var(--mb-radius-xl);
  box-shadow: var(--mb-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ----- Public site ----- */
.site-header, .site-footer {
  padding: 12px 16px;
  background: var(--mb-surface);
  border-block-end: 1px solid var(--mb-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer {
  border-block-end: 0;
  border-block-start: 1px solid var(--mb-border);
  color: var(--mb-muted);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mb-font-heading);
  font-weight: 700;
  font-size: 22px;
  color: var(--mb-forest);
  text-decoration: none;
}

/* The public header's "Donate" link (to the homepage's projects): always visible, a small filled pill. */
.site-donate {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--mb-forest);
  color: var(--mb-on-accent);
  font-weight: 700;
  text-decoration: none;
}

.site-donate:hover {
  background: var(--mb-forest-deep);
  color: var(--mb-on-accent);
}

/* FR-EXT-05: the organization's logo next to its name (header, sidebar, sign-in). */
.brand-logo {
  width: auto;
  height: 32px;
  max-width: 96px;
  object-fit: contain;
  vertical-align: middle;
  margin-inline-end: 8px;
}

.site-main {
  max-width: 72rem;
  margin-inline: auto;
  padding: 24px 16px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ----- Framework UI ----- */
.blazor-error-boundary {
  background: var(--mb-danger-bg);
  color: var(--mb-danger);
  padding: 16px;
  border-radius: var(--mb-radius);
}

#blazor-error-ui {
  background: var(--mb-warning-bg);
  color: var(--mb-warning-fg);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  inset-inline: 0;
  padding: 10px 20px;
  position: fixed;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  inset-inline-end: 12px;
  top: 8px;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Donation status, receipt and verification pages (FR-DON-06/07): one centred card, readable at 320 px. */
.ds, .rc {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--mb-radius-xl);
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  box-shadow: var(--mb-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ds h1, .rc h1 {
  margin: 0;
  font-family: var(--mb-font-heading);
  font-size: 1.75rem;
  line-height: 1.3;
}

.ds-facts, .rc-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.ds-facts dt, .rc-facts dt {
  color: var(--mb-muted);
}

.ds-facts dd, .rc-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rc-amount {
  font-size: 1.25rem;
}

.rc-eyebrow, .rc-lead, .ds-note {
  margin: 0;
  color: var(--mb-muted);
}

.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background: var(--mb-forest);
  color: var(--mb-on-accent);
  font-weight: 700;
  text-decoration: none;
}

.ds-button:hover {
  background: var(--mb-forest-deep);
  color: var(--mb-on-accent);
}

.ds-button-secondary {
  background: var(--mb-card-muted);
  color: var(--mb-ink);
  border: 1px solid var(--mb-border-strong);
}

.ds-button-secondary:hover {
  background: var(--mb-border);
  color: var(--mb-ink);
}

.rc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rc-verify {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--mb-border);
}

.rc-verify p {
  margin: 0 0 6px;
}

.rc-verify > div {
  min-width: 0;
}

.rc-code,
.rc-verify a,
.rc-facts dd {
  overflow-wrap: anywhere;
}

.rc-code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Two cards side by side on wide screens (dashboard donation detail). */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 16px;
  margin-block-end: 16px;
}

.timeline {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline li span + strong,
.timeline li strong + span {
  margin-inline-start: 8px;
}

.ds-spinner {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  border: 4px solid var(--mb-border);
  border-block-start-color: var(--mb-forest);
  animation: ds-spin 1s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .ds-spinner {
    animation: none;
  }
}

@media (max-width: 480px) {
  .rc-verify {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- P2-B: campaigns, volunteers, monthly giving, annual report ---- */

.pre-line {
  white-space: pre-line;
}

.checkin-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.checkin img {
  display: block;
  margin-block: 8px;
}

.hours-input {
  width: 5.5em;
  min-height: 44px; /* WCAG 2.5.8: a target of at least 24×24 px; 44 like the other controls */
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.copy-link {
  width: 100%;
  max-width: 100%;
}

.cp, .annual {
  display: grid;
  gap: 16px;
  max-width: 880px;
  margin-inline: auto;
}

.cp-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--mb-forest);
}

.cp-raised strong {
  font-size: 22px;
}

.cohort td,
.cohort th {
  text-align: center;
}

/* ---- Learning Center (ADR-45): guided tours, the «?» help panel, articles ---- */

.tour-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 51, 34, 0.55);
  outline: 3px solid var(--mb-forest-light);
  transition: top 0.15s ease, left 0.15s ease, width 0.15s ease, height 0.15s ease;
}

.tour-spotlight.hidden {
  display: none;
}

.tour-popover {
  position: fixed;
  max-width: min(360px, calc(100vw - 16px));
  padding: 14px 16px;
  background: var(--mb-card);
  color: var(--mb-ink);
  border: 1px solid var(--mb-border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 51, 34, 0.25);
  pointer-events: auto;
}

.tour-popover:focus {
  outline: none;
}

.tour-popover.centered {
  box-shadow: 0 0 0 9999px rgba(15, 51, 34, 0.45), 0 12px 32px rgba(15, 51, 34, 0.25);
}

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-title {
  margin: 6px 0;
  font-size: 17px;
}

.tour-body {
  margin: 0 0 10px;
  line-height: 1.7;
}

.tour-hint {
  margin: 0 0 10px;
  color: var(--mb-info-fg);
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tour-close {
  min-width: 32px;
  font-size: 20px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight {
    transition: none;
  }
}

.help-toggle {
  margin-inline-start: auto;
  min-width: 36px;
  border-radius: 999px;
  font-weight: 700;
}

.help-panel {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 900;
  width: min(380px, 100vw);
  overflow-y: auto;
  padding: 20px;
  background: var(--mb-card);
  border-inline-start: 1px solid var(--mb-border-strong);
  box-shadow: 0 0 24px rgba(15, 51, 34, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-panel h2 {
  margin: 0;
  font-size: 18px;
}

.help-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.tour-offer {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 950;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  background: var(--mb-card);
  border: 1px solid var(--mb-border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 51, 34, 0.2);
}

.learning {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 22px;
  align-items: start;
}

.learning-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.learning-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
}

.learning-nav a[aria-current="page"] {
  background: var(--mb-success-bg);
  font-weight: 600;
}

.help-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.help-results li {
  padding: 12px 14px;
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  background: var(--mb-card);
}

.help-results h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.help-article {
  line-height: 1.8;
  max-width: 820px;
}

.help-article h2 {
  font-size: 20px;
  margin-top: 1.4em;
}

.help-article h3 {
  font-size: 17px;
  margin-top: 1.2em;
}

.help-article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--mb-border);
}

.help-article code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--mb-card-muted);
  font-size: 0.92em;
}

.help-article pre {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mb-card-muted);
}

.help-article blockquote {
  margin: 1em 0;
  padding: 8px 14px;
  border-inline-start: 4px solid var(--mb-forest-light);
  background: var(--mb-success-bg);
  border-radius: 6px;
}

.help-answer {
  white-space: pre-line;
  line-height: 1.8;
}

.markdown-editor textarea {
  min-height: 320px;
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  line-height: 1.6;
}

.step-editor {
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  padding: 12px;
}

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

/* ADR-45: «لا تعرض الجولات مرة أخرى» — a text-style button inside the tour offer. */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mb-link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ----- Donor area (/account) and the header's sign-in ----- */
.site-header {
  flex-wrap: wrap;
}

.site-account {
  font-weight: 600;
}

.site-sign-out {
  display: inline-flex;
  margin: 0;
}

.site-sign-out .btn-link {
  min-height: 36px;
}

.acct {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .acct {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
  }
}

.acct-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

@media (min-width: 900px) {
  .acct-nav ul {
    flex-direction: column;
    overflow: visible;
    position: sticky;
    top: 16px;
  }
}

.acct-nav a {
  display: flex;
  align-items: center;
  min-height: var(--mb-touch);
  padding: 0 14px;
  border-radius: var(--mb-radius);
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
  color: var(--mb-ink);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.acct-nav a:hover {
  border-color: var(--mb-forest);
}

.acct-nav a[aria-current="page"] {
  background: var(--mb-forest);
  border-color: var(--mb-forest);
  color: var(--mb-on-accent);
}

.acct-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.acct-main h1,
.acct-main h2 {
  margin: 0;
}

.acct-main h2 {
  font-size: 1.15rem;
}

.acct-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.acct-cards,
.acct-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.acct-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.acct-cards .card,
.acct-item {
  padding: 16px;
  gap: 6px;
}

.acct-cards p,
.acct-item p {
  margin: 0;
}

.acct-card-link {
  font-weight: 700;
  font-size: 1.05rem;
}

.acct-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.acct-item-actions,
.acct-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.acct-actions form {
  margin: 0;
}

.acct-facts {
  display: grid;
  gap: 8px 16px;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}

.acct-facts dt {
  color: var(--mb-muted);
  font-size: 13px;
}

.acct-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.acct-confirm summary {
  list-style: none;
  cursor: pointer;
}

.acct-confirm summary::-webkit-details-marker {
  display: none;
}

.acct-confirm[open] {
  flex-basis: 100%;
}

.acct-confirm form {
  margin-top: 8px;
}

fieldset.acct-prefs {
  margin: 0;
  min-width: 0;
  padding: 16px;
  gap: 8px;
}

.acct-prefs legend {
  font-weight: 700;
  padding: 0 4px;
}

.acct-pref-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

.pp-follow {
  margin-block-start: 12px;
}

.acct-main fieldset.stack {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* ----- Site and app content (ADR-52): the dashboard editors ----- */
.btn-sm {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 10px;
  font-size: 0.875rem;
}

.sc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 16px;
}

.sc-tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--mb-border-strong);
  background: var(--mb-card);
  color: var(--mb-ink);
  text-decoration: none;
}

.sc-tabs a[aria-current="page"] {
  background: var(--mb-forest);
  border-color: var(--mb-forest);
  color: var(--mb-on-accent);
}

.sc-item,
.sc-actions,
.sc-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sc-row {
  display: flex;
  margin-block-end: 8px;
}

.sc-item img,
.sc-album-item img {
  border-radius: 6px;
  object-fit: cover;
  background: var(--mb-sand);
}

.sc-cards,
.sc-album-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-card,
.sc-album-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  background: var(--mb-card);
}

.sc-card .sc-actions {
  margin-inline-start: auto;
}

.sc-note {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--mb-chip-fundraising-bg);
  color: var(--mb-chip-fundraising-fg);
}

.sc-preview {
  padding: 12px;
  border: 1px dashed var(--mb-border-strong);
  border-radius: 10px;
  background: var(--mb-surface);
}

fieldset.mp,
fieldset.sc-album-items {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--mb-border);
  border-radius: 10px;
}

.mp legend,
.sc-album-items legend {
  font-weight: 700;
  padding: 0 4px;
}

.mp-current,
.mp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block-end: 8px;
}

.mp-current img {
  border-radius: 6px;
  object-fit: cover;
}

.mp-grid {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.mp-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 2px solid var(--mb-border);
  border-radius: 8px;
  background: var(--mb-card);
  color: var(--mb-ink);
  cursor: pointer;
}

.mp-item[aria-pressed="true"] {
  border-color: var(--mb-forest);
  box-shadow: 0 0 0 2px var(--mb-forest-light);
}

.mp-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
}

.mp-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.mp-doc,
.sp-doc-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 48px;
  border-radius: 6px;
  background: var(--mb-chip-danger-bg);
  color: var(--mb-chip-danger-fg);
  font-weight: 700;
}

/* ----- Site and app content (ADR-52): the public home's slides and cards ----- */
.ss {
  position: relative;
  border-radius: var(--mb-radius-xl);
  overflow: hidden;
  background: var(--mb-forest-deep);
}

.ss-slide {
  margin: 0;
  position: relative;
}

.ss-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
}

.ss-caption {
  margin: 0;
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 48px 24px 20px;
  background: linear-gradient(to top, rgba(15, 51, 34, 0.92), rgba(15, 51, 34, 0));
  color: #FFFFFF;
  font-family: var(--mb-font-heading);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  font-weight: 700;
}

.ss-caption a {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ss-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: var(--mb-forest-deep);
}

.ss-controls[hidden] {
  display: none;
}

.ss-button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #FFFFFF;
  font-size: 1.125rem;
  cursor: pointer;
}

[dir="ltr"] [data-ss-prev] span,
[dir="ltr"] [data-ss-next] span {
  display: inline-block;
  transform: scaleX(-1);
}

.ss-dots {
  display: flex;
  gap: 4px;
}

.ss-dot {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.ss-dot::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
}

.ss-dot[aria-current="true"]::after {
  background: #FFFFFF;
}

.ss-button:focus-visible,
.ss-dot:focus-visible,
.ss-caption a:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

.hc-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.hc-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
  box-shadow: var(--mb-shadow);
  color: var(--mb-ink);
  text-decoration: none;
}

.hc-card:hover {
  border-color: var(--mb-forest);
}

.hc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--mb-chip-completed-bg, var(--mb-card-muted));
  color: var(--mb-link);
  line-height: 1;
}

.hc-svg {
  display: block;
}

.hc-name {
  font-family: var(--mb-font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--mb-forest);
}

.hc-text {
  color: var(--mb-muted);
  font-size: 0.9375rem;
}

/* ----- Site and app content (ADR-52): partners, about, legal documents, media, map ----- */
.sp {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sp-narrow {
  max-width: 44rem;
}

.sp-header h1 {
  margin: 0 0 8px;
  font-family: var(--mb-font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}

.sp-lead {
  margin: 0;
  max-width: 44rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--mb-ink-strong);
}

.sp-muted {
  color: var(--mb-muted);
}

.sp-small {
  font-size: 0.875rem;
}

.sp-empty {
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--mb-border-strong);
  background: var(--mb-card-muted);
}

.sp-section h2,
.sp-subtitle {
  margin: 0 0 12px;
  font-family: var(--mb-font-heading);
  font-size: 1.375rem;
}

.sp-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.sp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
  box-shadow: var(--mb-shadow);
}

.sp-card h2,
.sp-card h3,
.sp-card-title {
  margin: 0;
  font-size: 1.125rem;
}

.sp-card p {
  margin: 0;
}

.sp-logo {
  width: 160px;
  height: 96px;
  object-fit: contain;
}

.sp-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: var(--mb-sand);
}

.sp-chip {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--mb-chip-completed-bg);
  color: var(--mb-chip-completed-fg);
  font-size: 0.8125rem;
}

.sp-chip-warn {
  background: var(--mb-chip-danger-bg);
  color: var(--mb-chip-danger-fg);
}

.sp-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.sp-prose {
  line-height: 1.9;
}

.sp-prose > :first-child {
  margin-block-start: 0;
}

.sp-figures {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.sp-figures li {
  min-width: 160px;
  padding: 16px;
  border-radius: 16px;
  background: var(--mb-card-muted);
  border: 1px solid var(--mb-border);
  display: flex;
  flex-direction: column;
}

.sp-figure {
  font-family: var(--mb-font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--mb-forest);
}

.sp-contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}

.sp-contact dt {
  font-weight: 700;
}

.sp-contact dd {
  margin: 0;
}

.sp-social,
.sp-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.sp-list {
  flex-direction: column;
}

.sp-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-doc {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.sp-doc > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.sp-doc-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 128px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--mb-border);
}

.sp-doc-pdf {
  width: 96px;
  height: 128px;
}

.sp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--mb-border-strong);
  color: var(--mb-ink);
  text-decoration: none;
  background: var(--mb-card);
}

.sp-tabs a[aria-current="page"] {
  background: var(--mb-forest);
  border-color: var(--mb-forest);
  color: var(--mb-on-accent);
}

.sp-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.sp-tile p {
  margin: 6px 0 0;
}

.mt {
  margin: 0;
}

.mt img,
.mt video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--mb-sand);
}

.mt figcaption {
  margin-block-start: 6px;
  font-size: 0.875rem;
  color: var(--mb-ink-strong);
}

.sp-map {
  width: 100%;
  height: 460px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--mb-border);
  background: var(--mb-card-muted);
}

.sp-crumbs a {
  font-size: 0.9375rem;
}

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

  .sp-grid,
  .sp-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .ss-slide img {
    aspect-ratio: 4 / 3;
  }

  .sp-map {
    height: 340px;
  }
}

/* ----- Volunteering (ADR-53): the public form and the events that fit ----- */
.volunteer-page .inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.volunteer-page .inline-fields input {
  width: auto;
  min-width: 9rem;
}

.vp-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vp-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mb-border);
}

.vp-event h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.vp-event p {
  margin: 0;
}

.type-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.type-choices legend,
.type-choices .field-hint {
  flex-basis: 100%;
}

/* ----- Tree-cutting reports (ADR-54): the public form, its tracking and the dashboard ----- */
.report-page .inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.report-page .inline-fields input {
  width: 11rem;
  max-width: 100%;
}

.rf-map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--mb-border);
  background: var(--mb-card-muted);
}

.rf-code {
  word-break: break-all;
}

.rt-history,
.tr-timeline {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.rt-history li,
.tr-timeline li {
  margin-block: 0.35rem;
}

.rm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.rm-reference {
  font-size: 1.05rem;
  margin: 0;
}

.tr-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tr-photos img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--mb-border);
}

.tr-map {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--mb-border);
  background: var(--mb-card-muted);
}

.tr-flag {
  color: var(--mb-danger, #B42318);
  font-weight: 600;
}

/* ===================================================================================================================
   Public site redesign (v0.1.9): deep forest header and footer, amber "Donate", Alexandria headings, a full-width photo hero,
   impact figures, larger cards, a field mosaic and a phone-first layout with a sticky "Donate". Overrides the rules above.
   =================================================================================================================== */

/* ----- Buttons ----- */
.btn-donate {
  background: var(--mb-accent);
  border-color: var(--mb-accent);
  color: var(--mb-on-warm);
  font-weight: 700;
}

.btn-donate:hover:not(:disabled) {
  background: var(--mb-accent-hover);
  border-color: var(--mb-accent-hover);
  color: var(--mb-on-warm);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #FFFFFF;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.btn-light {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--mb-forest-deep);
  font-weight: 700;
}

.btn-light:hover:not(:disabled) {
  background: #EEF4EF;
  color: var(--mb-forest-deep);
}

/* ----- Header ----- */
.site-header {
  display: block;
  padding: 0;
  background: var(--mb-forest-deep);
  border: 0;
  color: #FFFFFF;
  position: relative;
  z-index: 20;
}

.sh-inner {
  max-width: 77.5rem;
  margin-inline: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  font-size: 21px;
  font-weight: 800;
}

.sh-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #FFFFFF;
  color: var(--mb-leaf);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.site-header .brand:has(.brand-logo) .sh-mark {
  display: none;
}

.site-header .brand-logo {
  height: 36px;
  border-radius: 8px;
  background: #FFFFFF;
}

.sh-menu {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.sh-menu > summary {
  display: none;
}

.sh-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sh-nav a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
}

.sh-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.sh-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-header .site-account,
.site-header .language-switch,
.site-header .btn-link {
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-header .site-account {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding-inline: 14px;
}

.site-donate {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--mb-accent);
  color: var(--mb-on-warm);
}

.site-donate:hover {
  background: var(--mb-accent-hover);
  color: var(--mb-on-warm);
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hp-hero :focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

/* ----- Footer ----- */
.site-footer {
  display: block;
  padding: 0;
  margin-block-start: 48px;
  background: var(--mb-forest-night);
  color: #D7E6DC;
  border: 0;
}

.sf-inner {
  max-width: 77.5rem;
  margin-inline: auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 32px;
}

.sf-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.sf-name {
  font-family: var(--mb-font-heading);
  font-weight: 800;
  font-size: 22px;
  color: #FFFFFF;
}

.sf-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sf-col h2 {
  margin: 0 0 6px;
  font-family: var(--mb-font-body);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.site-footer a:not(.site-donate) {
  color: #D7E6DC;
  text-decoration: none;
  padding: 6px 0;
}

.site-footer a:not(.site-donate):hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* ----- Home: full-width layout ----- */
.site-main:has(> .hp) {
  max-width: none;
  padding: 0;
  gap: 0;
}

.hp {
  display: flex;
  flex-direction: column;
}

.hp-section,
.hp-band,
.hp-stats {
  width: 100%;
  max-width: 77.5rem;
  margin-inline: auto;
  padding-inline: 24px;
  box-sizing: border-box;
}

.hp-section {
  padding-block: 72px 0;
}

.hp-section h2,
.hp-hero h1 {
  font-family: var(--mb-font-heading);
  font-weight: 800;
}

.hp-section h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  line-height: 1.3;
}

.hp-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 28px;
}

.hp-kicker {
  margin: 0 0 8px;
  color: var(--mb-leaf);
  font-weight: 700;
  font-size: 0.95rem;
}

.hp-muted {
  color: var(--mb-muted);
}

.hp-small {
  font-size: 0.9rem;
}

.hp-strong {
  font-weight: 700;
}

/* ----- Home: hero ----- */
.hp-hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--mb-forest-deep);
  color: #FFFFFF;
}

.hp-hero-plain {
  min-height: 520px;
  background:
    radial-gradient(circle at 15% 20%, rgba(166, 217, 106, 0.18) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(47, 125, 79, 0.55) 0, transparent 45%),
    var(--mb-forest-deep);
}

.hp-hero .ss {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.hp-hero .ss-viewport,
.hp-hero .ss-slide {
  height: 100%;
}

.hp-hero .ss-slide img {
  height: 100%;
  aspect-ratio: auto;
}

.hp-hero .ss-caption {
  inset-block-end: 26px;
  inset-inline: 24px auto;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(8, 36, 28, 0.66);
  font-family: var(--mb-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 3;
  max-width: min(420px, 60%);
}

.hp-hero .ss-controls {
  position: absolute;
  inset-block-end: 20px;
  inset-inline-end: 24px;
  z-index: 4;
  background: rgba(8, 36, 28, 0.5);
  border-radius: 999px;
  padding: 2px 6px;
}

.hp-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(8, 36, 28, 0.9) 0%, rgba(8, 36, 28, 0) 45%),
    linear-gradient(to left, rgba(8, 36, 28, 0.85) 0%, rgba(8, 36, 28, 0.55) 40%, rgba(8, 36, 28, 0.05) 80%);
}

[dir="ltr"] .hp-scrim {
  background:
    linear-gradient(to top, rgba(8, 36, 28, 0.9) 0%, rgba(8, 36, 28, 0) 45%),
    linear-gradient(to right, rgba(8, 36, 28, 0.85) 0%, rgba(8, 36, 28, 0.55) 40%, rgba(8, 36, 28, 0.05) 80%);
}

.hp-hero-plain .hp-scrim {
  display: none;
}

.hp-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 77.5rem;
  margin-inline: auto;
  padding: 96px 24px 120px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hp-hero-inner > * {
  max-width: 38rem;
}

.hp-eyebrow {
  margin: 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(166, 217, 106, 0.18);
  border: 1px solid rgba(166, 217, 106, 0.42);
  color: #D9F2BC;
  font-weight: 600;
  font-size: 0.9rem;
}

.hp-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #A6D96A;
}

.hp-hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.4vw, 4rem);
  line-height: 1.2;
}

.hp-lead {
  margin: 0;
  font-size: clamp(1.02rem, 1.6vw, 1.25rem);
  line-height: 1.8;
  color: #E4EFE7;
}

.hp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-block-start: 4px;
}

.hp-hero-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #C9EBA1;
}

.hp-hero-links a {
  color: #C9EBA1;
  font-weight: 600;
}

/* ----- Home: impact figures ----- */
.hp-stats {
  position: relative;
  z-index: 5;
  margin-block-start: -48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  background: var(--mb-card);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(14, 59, 46, 0.16);
  width: calc(100% - 48px);
}

.hp-stat {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-inline-end: 1px solid var(--mb-border);
}

.hp-stat:last-child {
  border-inline-end: 0;
}

.hp-stat-value {
  font-family: var(--mb-font-heading);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--mb-forest-deep);
}

.hp-stat-accent {
  color: #A15F00;
}

.hp-stat-label {
  color: var(--mb-muted);
  font-size: 0.95rem;
}

/* ----- Home: cards band ----- */
.hp-band {
  padding-block-start: 56px;
}

.hc-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.hc-card {
  gap: 10px;
  padding: 20px;
  border-radius: 20px;
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hc-card:hover {
  border-color: var(--mb-leaf);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(14, 59, 46, 0.1);
}

.hc-icon {
  border-radius: 14px;
  background: #E6F1E9;
  color: var(--mb-leaf);
}

.hc-name {
  color: var(--mb-ink);
  font-size: 1.05rem;
}

.hc-card[data-testid="home-card-Donate"] {
  background: #FFF4E2;
  border-color: #F6DDB2;
}

.hc-card[data-testid="home-card-Donate"] .hc-icon {
  background: #FDE3B5;
  color: #8A5200;
}

.hc-card[data-testid="home-card-ReportTreeCutting"] {
  background: #FDF0EE;
  border-color: #F3D3CE;
}

.hc-card[data-testid="home-card-ReportTreeCutting"] .hc-icon {
  background: #F8DCD7;
  color: #9E2A1F;
}

/* ----- Home: projects ----- */
.hp-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}

.hp-card {
  display: flex;
  flex-direction: column;
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(14, 59, 46, 0.06);
}

.hp-cover-wrap {
  position: relative;
}

.hp-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hp-cover-empty {
  background: linear-gradient(135deg, #DCE8DF, #C9DCCF);
}

.hp-cover-chip {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-start: 14px;
}

.hp-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.hp-card-body h3 {
  margin: 0;
  font-family: var(--mb-font-heading);
  font-size: 1.3rem;
}

.hp-card-body h3 a {
  color: var(--mb-ink);
  text-decoration: none;
}

.hp-card-body h3 a:hover {
  text-decoration: underline;
}

.hp-card-body p {
  margin: 0;
}

.hp-figure {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.95rem;
}

.hp-bar {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  background: #EEF3EF;
}

.hp-bar::-webkit-progress-bar {
  background: #EEF3EF;
  border-radius: 999px;
}

.hp-bar::-webkit-progress-value {
  background: var(--mb-leaf);
  border-radius: 999px;
}

.hp-bar::-moz-progress-bar {
  background: var(--mb-leaf);
  border-radius: 999px;
}

.hp-bar-funding::-webkit-progress-value {
  background: var(--mb-accent);
}

.hp-bar-funding::-moz-progress-bar {
  background: var(--mb-accent);
}

.hp-card-actions {
  margin-block-start: auto;
  padding-block-start: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.hp-card-general {
  position: relative;
  min-height: 420px;
  background: var(--mb-forest-deep);
  color: #FFFFFF;
  justify-content: flex-end;
}

.hp-general-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-card-general::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 36, 28, 0.94) 15%, rgba(8, 36, 28, 0.15) 75%);
}

.hp-general-body {
  position: relative;
  z-index: 1;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hp-general-body h3 {
  margin: 0;
  font-family: var(--mb-font-heading);
  font-size: 1.5rem;
}

.hp-general-body p {
  margin: 0;
  color: #E4EFE7;
  line-height: 1.7;
}

.hp-empty {
  padding: 32px;
  border-radius: 20px;
  border: 1px dashed var(--mb-border-strong);
  background: var(--mb-card);
  text-align: center;
}

/* ----- Home: field mosaic ----- */
.hp-mosaic {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  gap: 14px;
}

.hp-mosaic li:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.hp-mosaic li:nth-child(4) {
  grid-column: span 2;
}

.hp-mosaic figure {
  margin: 0;
  position: relative;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
}

.hp-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.hp-mosaic figure:hover img {
  transform: scale(1.04);
}

.hp-mosaic figcaption {
  position: absolute;
  inset-block-end: 12px;
  inset-inline-start: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(8, 36, 28, 0.75);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ----- Home: campaigns ----- */
.hp-campaigns {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.hp-campaign {
  padding: 20px;
  border-radius: 20px;
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hp-campaign h3,
.hp-campaign p {
  margin: 0;
}

/* ----- Home: how it works ----- */
.hp-how {
  text-align: center;
}

.hp-how > h2 {
  margin-block-end: 28px;
}

.hp-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 32px;
  border-radius: 32px;
  background: var(--mb-card-muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 18px;
  text-align: start;
}

.hp-steps li {
  counter-increment: step;
  padding: 26px;
  border-radius: 22px;
  background: var(--mb-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hp-steps li::before {
  content: counter(step, arabic-indic);
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mb-forest-deep);
  color: #FFFFFF;
  font-family: var(--mb-font-heading);
  font-weight: 800;
  font-size: 1.3rem;
}

[lang="en"] .hp-steps li::before {
  content: counter(step);
}

.hp-steps li:nth-child(2)::before {
  background: var(--mb-accent);
  color: var(--mb-on-warm);
}

.hp-steps li:nth-child(3)::before {
  background: var(--mb-leaf);
}

.hp-steps h3 {
  margin: 0;
  font-family: var(--mb-font-heading);
  font-size: 1.25rem;
}

.hp-steps p {
  margin: 0;
  line-height: 1.8;
}

/* ----- Home: volunteering ----- */
.hp-volunteer {
  display: flex;
  flex-wrap: wrap;
  border-radius: 32px;
  overflow: hidden;
  background: var(--mb-forest-deep);
  color: #FFFFFF;
}

.hp-volunteer-body {
  flex: 1 1 420px;
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
}

.hp-volunteer-body h2 {
  color: #FFFFFF;
}

.hp-volunteer-body p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #D7E6DC;
}

.hp-volunteer-photo {
  flex: 1 1 380px;
  min-height: 340px;
  max-width: 100%;
  object-fit: cover;
}

.hp-sticky-donate {
  display: none;
}

/* ----- Phones and small tablets ----- */
@media (max-width: 860px) {
  .sh-inner {
    padding: 10px 16px;
    gap: 8px;
  }

  .sh-menu {
    order: 3;
    flex: 0 0 auto;
    margin-inline-start: auto;
    position: relative;
  }

  .sh-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

  .sh-menu > summary::-webkit-details-marker {
    display: none;
  }

  .sh-menu > summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .sh-menu[open] .sh-nav {
    position: absolute;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    width: min(86vw, 300px);
    flex-direction: column;
    background: var(--mb-forest-deep);
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }

  .sh-menu:not([open]) .sh-nav {
    display: none;
  }

  .sh-actions {
    order: 2;
    gap: 4px;
  }

  .sh-actions .site-donate {
    display: none;
  }

  .site-header .site-account {
    border: 0;
    padding-inline: 8px;
  }

  .site-header .brand {
    font-size: 18px;
  }

  .sh-mark {
    width: 38px;
    height: 38px;
  }

  .hp-section,
  .hp-band {
    padding-inline: 16px;
  }

  .hp-section {
    padding-block-start: 48px;
  }

  .hp-hero {
    min-height: 600px;
  }

  .hp-hero-inner {
    padding: 48px 16px 96px;
  }

  .hp-scrim,
  [dir="ltr"] .hp-scrim {
    background: linear-gradient(to top, rgba(8, 36, 28, 0.96) 0%, rgba(8, 36, 28, 0.72) 50%, rgba(8, 36, 28, 0.25) 85%);
  }

  .hp-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hp-actions .btn {
    justify-content: center;
    text-align: center;
  }

  .hp-hero .ss-caption {
    display: none;
  }

  .hp-hero .ss-controls {
    inset-inline: 16px auto;
    inset-block-end: 16px;
  }

  .hp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - 32px);
    margin-block-start: -36px;
    border-radius: 20px;
  }

  .hp-stat {
    padding: 18px;
    border-inline-end: 0;
  }

  .hp-stat:nth-child(odd) {
    border-inline-end: 1px solid var(--mb-border);
  }

  .hp-stat:nth-child(-n + 2) {
    border-block-end: 1px solid var(--mb-border);
  }

  .hp-band {
    padding-block-start: 32px;
  }

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

  .hc-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
  }

  .hc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .hc-text {
    display: none;
  }

  .hp-mosaic {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-block-end: 4px;
  }

  .hp-mosaic li {
    flex: 0 0 72%;
    height: 210px;
    scroll-snap-align: start;
  }

  .hp-steps {
    padding: 16px;
    border-radius: 24px;
  }

  .hp-steps li {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px;
  }

  .hp-steps li::before {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .hp-volunteer {
    border-radius: 24px;
    flex-direction: column-reverse;
  }

  .hp-volunteer-photo {
    min-height: 200px;
    max-height: 220px;
    width: 100%;
  }

  .hp-volunteer-body {
    flex-basis: auto;
    padding: 24px 20px;
  }

  .hp-sticky-donate {
    display: block;
    position: sticky;
    inset-block-end: 0;
    z-index: 30;
    margin-block-start: 32px;
    padding: 12px 16px 14px;
    background: rgba(251, 250, 247, 0.96);
    border-block-start: 1px solid var(--mb-border);
    backdrop-filter: blur(6px);
  }

  .site-footer {
    margin-block-start: 0;
  }

  .sf-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 36px 16px 28px;
    gap: 24px;
  }

  .sf-brand {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hc-card,
  .hp-mosaic img {
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  .hc-icon {
    background: var(--mb-chip-completed-bg);
  }

  .hc-card[data-testid="home-card-Donate"],
  .hc-card[data-testid="home-card-ReportTreeCutting"] {
    background: var(--mb-card);
    border-color: var(--mb-border);
  }

  .hp-stat-value {
    color: var(--mb-ink);
  }

  .hp-stat-accent {
    color: #F2C77E;
  }

  .hp-sticky-donate {
    background: rgba(11, 13, 12, 0.94);
  }
}

/* ----- Media library (v0.1.9): batch upload, selection, permanent delete, drag-and-drop ordering ----- */
.ml-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mb-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ml-tab[aria-pressed="true"] {
  background: var(--mb-forest-deep);
  color: #FFFFFF;
}

.ml-upload {
  margin-block: 16px;
}

.bu-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 2px dashed var(--mb-border-strong);
  border-radius: 18px;
  background: var(--mb-card-muted);
}

.bu-zone.dragging {
  border-color: var(--mb-leaf);
  background: #E6F1E9;
}

.bu-icon {
  color: var(--mb-leaf);
}

.bu-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.bu-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
}

.bu-file progress {
  width: 120px;
}

.bu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block: 8px 12px;
}

.ml-toolbar h2 {
  margin: 0;
}

.ml-filters,
.ml-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ml-confirm {
  margin-block-end: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--mb-chip-danger-fg);
  background: var(--mb-danger-bg);
}

.ml-confirm h3 {
  margin: 0 0 6px;
}

.ml-result {
  margin-block-end: 12px;
}

.ml-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 14px;
}

.ml-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
}

.ml-item.ml-chosen {
  border-color: var(--mb-leaf);
  box-shadow: 0 0 0 2px var(--mb-leaf);
}

.ml-pick {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 2;
  background: var(--mb-card-muted);
}

.ml-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ml-pick input[type="checkbox"] {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  width: 22px;
  height: 22px;
  z-index: 1;
  accent-color: var(--mb-leaf);
}

.ml-doc {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ml-badge {
  position: absolute;
  inset-block-end: 8px;
  inset-inline-end: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 36, 28, 0.7);
  color: #FFFFFF;
  font-size: 12px;
}

.ml-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 44px;
  margin-inline-end: 4px;
  color: var(--mb-muted);
  font-size: 18px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sortable.sort-active,
.sortable.sort-active .drag-handle {
  cursor: grabbing;
}

.sort-lifted {
  position: relative;
  z-index: 5;
  background: var(--mb-card);
  box-shadow: 0 12px 30px rgba(14, 59, 46, 0.22);
  opacity: 0.96;
}

.sort-over-before {
  box-shadow: inset 0 3px 0 var(--mb-leaf);
}

.sort-over-after {
  box-shadow: inset 0 -3px 0 var(--mb-leaf);
}

@media (prefers-reduced-motion: reduce) {
  .sort-lifted {
    box-shadow: none;
  }
}
