/* YIHA — modern lean charity site
   Colour charter (HOPE monogram brown): primary #E0A068 / deep #9A6430 / navy formal #123A56 */
:root {
  --ink: #1c1610;
  --ink-soft: #4a3f35;
  --muted: #7a6b5c;
  --line: #eadfce;
  --bg: #faf6f0;
  --card: #ffffff;
  /* Brand brown — WCAG AA: use --brand-dark for text/buttons on white */
  --brand: #9a6430;
  --brand-mid: #c4843a;
  --brand-dark: #7a4e24;
  --brand-soft: #f7ecdf;
  --accent: #7a3410;
  --accent-soft: #f3e6d8;
  --navy: #123a56;
  --navy-soft: #e7eef3;
  --hope: #c4843a;
  --hope-soft: #f7ecdf;
  --level-0: #a89888;
  --level-1: #3b82f6;
  --level-2: #8b5cf6;
  --level-3: #d4a017;
  --level-4: #c45c26;
  --level-5: #2f7d4a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(28, 22, 16, 0.08);
  --shadow-sm: 0 2px 10px rgba(28, 22, 16, 0.06);
  --max: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  /* Type scale (desktop default) */
  --fs-body: 1rem;
  --fs-lead: 1.08rem;
  --fs-h1: clamp(2rem, 4vw, 3.1rem);
  --fs-h2: clamp(1.35rem, 2.5vw, 2rem);
  --fs-h3: 1.05rem;
  --fs-small: 0.82rem;
  --fs-ui: 0.78rem;
  --pad-section: 2.75rem;
  --pad-card: 1.15rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

/* Version bar */
.version-bar {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-mid));
  color: #fff8ef;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0;
}
.version-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}
.version-bar strong {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}
.version-bar .muted-on-dark {
  opacity: 0.92;
  font-weight: 500;
}

/* Header — desktop + mobile (iOS notch / Android / Chinese WebViews) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  /* iPhone safe area (notch / home indicator) */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand-mid), var(--brand-dark));
  border: 1px solid transparent;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  background: #fff;
}
.brand-text { line-height: 1.15; }
.brand-text small {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}
.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lang-switch,
.vision-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: white;
  /* Avoid text size inflation quirks on some Chinese Android browsers */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.lang-switch button,
.vision-switch button {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.2;
  /* Touch: min ~44px target on coarse pointers */
  min-height: 2.5rem;
  min-width: 2.5rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(154, 100, 48, 0.2);
  user-select: none;
  -webkit-user-select: none;
}
.lang-switch button[aria-pressed="true"],
.vision-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.vision-switch {
  max-width: 100%;
  flex-wrap: nowrap;
}
.a11y-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
/* Live region for mobile screen readers after mode change */
#display-mode-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.mobile-a11y-strip {
  display: none;
  width: 100%;
  flex-basis: 100%;
  order: 5;
  padding: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
}
.mobile-a11y-strip .mobile-a11y-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.mobile-a11y-strip .strip-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--brand-dark);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(122, 78, 36, 0.28);
}
.btn-primary:hover { background: #5c3a1a; }
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.chip:focus-visible,
.lang-switch button:focus-visible,
.nav a:focus-visible,
.activity-card:focus-visible {
  outline: 3px solid #1a6bb5;
  outline-offset: 2px;
}
.btn-secondary {
  background: white;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
.btn-accent {
  background: var(--accent);
  color: white !important;
}
.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(224, 160, 104, 0.28), transparent 38%),
    radial-gradient(circle at 88% 10%, rgba(18, 58, 86, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero-photo {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #ddd;
  position: relative;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}
.hero-photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(transparent, rgba(28, 22, 16, 0.72));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}
.media-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: center;
}
.media-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.media-card img {
  margin: 0 auto 0.85rem;
  max-height: 220px;
  width: auto;
  object-fit: contain;
}
.media-card.photo img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
}
.media-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.media-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.hope-watermark {
  float: right;
  width: min(140px, 28vw);
  margin: 0 0 0.5rem 1rem;
  opacity: 0.9;
}
.navy-panel {
  background: var(--navy);
  color: #e8eef4;
  border-radius: var(--radius);
  padding: 1.5rem;
}
.navy-panel h2 { color: #fff; margin-top: 0; }
.navy-panel p { color: #c9d7e3; }
.navy-panel a { color: #f0c090; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
/* Default DOM order: text then photo — preserve for mobile stack (text above, image below) */
.hero-grid > * {
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: var(--fs-h1);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--brand); }
.lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.75rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.stats-linked .stat {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.stats-linked .stat:hover {
  border-color: var(--brand-mid);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.stats-linked .stat:focus-visible {
  outline: 3px solid #1a6bb5;
  outline-offset: 2px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-sm);
}
.stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}
.stat span { font-size: 0.78rem; color: var(--muted); }

.level-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
}
.level-chip span:first-child {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.72rem;
}
.level-chip:hover {
  border-color: var(--brand-mid);
  background: var(--brand-soft);
}
.level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.level-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.level-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.hope-chapter-links {
  flex-direction: column;
  align-items: stretch;
}
.hope-chapter-links .btn {
  text-align: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .level-cards {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
}
.hero-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.hero-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.hero-card p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.95rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.checklist li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "✓";
  color: var(--brand-dark);
  font-weight: 800;
  flex-shrink: 0;
}

/* Sections */
main { flex: 1; }
.section { padding: 3rem 0; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.section-header h2 {
  margin: 0 0 0.35rem;
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
}
.section-header p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 1rem; }
.muted { color: var(--muted); }
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* Activity cards */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"],
.chip:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.activity-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.activity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: start;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-id { background: var(--ink); color: white; }
/* Status badges: text + icon + border (WCAG 1.4.1 colour not sole cue); AA contrast */
.badge-status {
  background: #fff8ef;
  color: #5c3d18;
  border: 1px solid #9a6430;
}
.badge-status.complete {
  background: #e8f5ee;
  color: #0b5c3a;
  border: 1px solid #0b5c3a;
  border-style: solid;
}
.badge-status.open {
  background: #fff4ec;
  color: #7a3410;
  border: 1px solid #7a3410;
  border-style: dashed;
}
.badge-status.planning {
  background: #eef2ff;
  color: #312e81;
  border: 1px solid #312e81;
  border-style: dotted;
}
.level {
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  background: var(--level-0);
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
}
.level-1 { background: var(--level-1); }
.level-2 { background: var(--level-2); }
.level-3 { background: var(--level-3); color: #1f2937; }
.level-4 { background: var(--level-4); }
.level-5 { background: var(--level-5); }
.activity-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.activity-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  flex: 1;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.progress {
  height: 8px;
  background: #e8eef5;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-mid));
  border-radius: inherit;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Detail */
.detail-hero {
  padding: 2.5rem 0 1.5rem;
  background: white;
  border-bottom: 1px solid var(--line);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.25rem;
  padding: 2rem 0 3rem;
}
.detail-side .panel { position: sticky; top: 5.5rem; }
.kv { display: grid; gap: 0.75rem; }
.kv div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
  font-size: 0.92rem;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }

/* Forms */
form { display: grid; gap: 0.9rem; }
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: white;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(11, 110, 79, 0.25);
  border-color: var(--brand);
}
textarea { min-height: 140px; resize: vertical; }
.form-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: #fafcfe; }

/* Quote / footer */
.quote {
  border-left: 4px solid var(--brand);
  background: white;
  padding: 1.1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
  font-style: italic;
}
.quote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.85rem;
}
.site-footer {
  margin-top: auto;
  background: #2a2118;
  color: #d9cbb8;
  padding: 2.25rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.site-footer a { color: #e8eef7; text-decoration: none; }
.site-footer a:hover { color: white; text-decoration: underline; }
.site-footer h3 {
  margin: 0 0 0.7rem;
  color: white;
  font-size: 0.95rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-version {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #a8b7c9;
  display: grid;
  gap: 0.25rem;
}
.footer-version strong { color: #e8eef7; }
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Support / payment */
.payment-locked {
  border: 1px dashed var(--line);
  background: #fbf7f1;
}
.payment-unlocked {
  border-color: var(--brand-mid);
  box-shadow: var(--shadow);
}
.payment-method {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.payment-method.preferred {
  border-color: var(--brand-mid);
  background: var(--brand-soft);
}
.payment-method.optional {
  background: #fff;
}
.payment-method-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.payment-method-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.offer-summary {
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0 0;
}
code.copyable {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.88rem;
  word-break: break-all;
}
code.copyable.copied {
  border-color: var(--brand-dark);
  background: #fff8ef;
}
.payment-method .kv {
  margin-top: 0.75rem;
}

/* Responsive — phones (iPhone / Android Google / Chinese OS WebViews) */
@media (max-width: 900px) {
  .hero-grid,
  .grid-2,
  .detail-grid,
  .footer-grid,
  .media-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .hope-watermark { float: none; display: block; margin: 0 auto 1rem; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
    align-items: stretch;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav.open { display: flex; }
  .menu-toggle {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  .header-inner {
    position: relative;
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }
  /* Full-width row: language + display always visible on phone */
  .header-actions {
    width: 100%;
    order: 3;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
  }
  .header-actions .btn-donate-desktop { display: none; }
  /* Hide compact tools in top-right; show dedicated mobile strip labels */
  .header-actions .a11y-toolbar-label-mobile {
    display: none;
  }
  .lang-switch,
  .vision-switch {
    flex: 1 1 auto;
    justify-content: stretch;
  }
  .lang-switch button,
  .vision-switch button {
    flex: 1 1 0;
    min-height: 44px;
    min-width: 0;
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
  }
  .detail-side .panel { position: static; }
  .version-bar {
    font-size: 0.7rem;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
  }
  .version-bar .container {
    gap: 0.35rem;
  }
  /* Dichotomy stacks already; ensure cards don't overflow Chinese font metrics */
  .activity-card h3 {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .pay-split,
  .flow-split,
  .dichotomy-board {
    grid-template-columns: 1fr;
  }
}

/* —— Phone portrait: compact type (iPhone / Android / Chinese OS) —— */
@media (max-width: 480px), (max-width: 900px) and (orientation: portrait) and (max-height: 950px) {
  :root {
    --fs-body: 0.8125rem;   /* 13px */
    --fs-lead: 0.875rem;    /* 14px */
    --fs-h1: 1.25rem;       /* 20px — was ~1.55–2rem, too large */
    --fs-h2: 1.05rem;       /* 17px */
    --fs-h3: 0.9rem;
    --fs-small: 0.7rem;
    --fs-ui: 0.68rem;
    --pad-section: 1.25rem;
    --pad-card: 0.75rem;
    --radius: 10px;
  }

  body {
    line-height: 1.45;
  }

  .container {
    width: min(100% - 1rem, var(--max));
  }

  .version-bar {
    font-size: 0.62rem;
    padding: 0.28rem 0;
  }
  .version-bar .muted-on-dark:last-child {
    display: none; /* free vertical space on phones */
  }

  .header-inner {
    padding: 0.45rem 0;
    gap: 0.4rem;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.58rem;
    border-radius: 9px;
  }
  .brand-text {
    font-size: 0.88rem;
  }
  .brand-text small {
    display: none;
  }

  .lang-switch button,
  .vision-switch button,
  .layout-menu-trigger {
    min-height: 2.15rem;
    min-width: 0;
    padding: 0.35rem 0.3rem;
    font-size: 0.65rem;
  }
  .layout-menu-trigger {
    padding: 0.35rem 0.5rem;
  }
  #layout-trigger-label {
    max-width: 4.5rem;
  }
  .menu-toggle {
    min-width: 2.15rem;
    min-height: 2.15rem;
    font-size: 0.95rem;
  }

  .nav a {
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
  }

  .hero,
  .hero-fluid {
    padding: 1.15rem 0 1rem;
  }
  .hero h1 {
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
  }
  .lead {
    margin-bottom: 0.85rem;
  }
  .hero-cta {
    gap: 0.4rem;
  }
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }
  .stats {
    gap: 0.4rem;
  }
  .stat {
    padding: 0.5rem 0.55rem;
  }
  .stat strong {
    font-size: 0.95rem;
  }
  .stat span {
    font-size: 0.65rem;
  }
  .hero-photo figcaption {
    font-size: 0.65rem;
    padding: 0.4rem 0.55rem;
  }

  .section,
  .flow-band {
    padding: var(--pad-section) 0;
  }
  .section-header {
    margin-bottom: 0.75rem;
    gap: 0.5rem;
  }
  .section-header p {
    font-size: var(--fs-small);
  }
  .panel,
  .activity-card,
  .media-card,
  .navy-panel {
    padding: var(--pad-card);
  }
  .activity-card h3,
  .media-card h3 {
    font-size: var(--fs-h3);
  }
  .activity-card p,
  .media-card p {
    font-size: 0.78rem;
  }
  .badge,
  .tag,
  .level {
    font-size: 0.62rem;
  }
  .checklist li,
  .flow-steps li {
    font-size: 0.78rem;
  }
  .quote {
    font-size: 0.8rem;
    padding: 0.75rem 0.85rem;
  }
  .site-footer {
    padding: 1.35rem 0 1rem;
    font-size: 0.75rem;
  }
  .site-footer h3 {
    font-size: 0.85rem;
  }
  .footer-version {
    font-size: 0.68rem;
  }
  .dichotomy-col-head h3 {
    font-size: 0.95rem;
  }
  .dichotomy-col-head p {
    font-size: 0.75rem;
  }
  .dichotomy-a11y-note,
  .wwft-box {
    font-size: 0.75rem;
    padding: 0.65rem 0.75rem;
  }
  .count-pill {
    font-size: 0.7rem;
    min-width: 1.4rem;
    padding: 0.08rem 0.4rem;
  }
  table {
    font-size: 0.75rem;
  }
  th, td {
    padding: 0.45rem 0.35rem;
  }
  input, textarea, select {
    font-size: 16px; /* iOS: avoid auto-zoom on focus, but keep compact labels */
    padding: 0.55rem 0.65rem;
  }
  label {
    font-size: 0.78rem;
  }
  .form-note,
  .chapter-num {
    font-size: 0.68rem;
  }
  .chapter-panel h2,
  .panel h2 {
    font-size: 1rem;
  }
  .flow-progress li {
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
  }
  .flow-progress li span {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.68rem;
  }
  .identity-fieldset,
  .legal-quiz {
    padding: 0.65rem 0.7rem 0.75rem;
  }
  .activity-clue-box {
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
  }
  .code-lg {
    font-size: 0.85rem;
  }

  /* Mono filter is heavy on low-end Chinese Android — lighten cost */
  html[data-display="mono"] body {
    filter: grayscale(1);
  }
  html[data-display="mono"] img {
    filter: none;
  }
}

/* Very narrow phones (≤360 CSS px) */
@media (max-width: 360px) {
  :root {
    --fs-body: 0.75rem;
    --fs-lead: 0.8125rem;
    --fs-h1: 1.15rem;
    --fs-h2: 0.98rem;
  }
  .lang-switch button,
  .vision-switch button {
    font-size: 0.6rem;
    padding: 0.3rem 0.2rem;
  }
}

/* Affichage presets: force phone type scale even on large desktop when previewing */
html[data-layout="iphone-portrait"],
html[data-layout="android-phone"],
html[data-layout="chinese-phone"],
html[data-layout="foldable"] {
  --fs-body: 0.8125rem;
  --fs-lead: 0.875rem;
  --fs-h1: 1.2rem;
  --fs-h2: 1.02rem;
  --fs-h3: 0.88rem;
  --fs-small: 0.7rem;
  --fs-ui: 0.68rem;
  --pad-section: 1.15rem;
  --pad-card: 0.7rem;
}
html[data-layout="iphone-portrait"] .layout-preview-frame,
html[data-layout="android-phone"] .layout-preview-frame,
html[data-layout="chinese-phone"] .layout-preview-frame,
html[data-layout="foldable"] .layout-preview-frame {
  font-size: 0.8125rem;
}
/* iPad / tablet: slightly tighter than desktop, not as tight as phone */
html[data-layout="ipad-landscape"],
html[data-layout="android-tablet"] {
  --fs-body: 0.9rem;
  --fs-lead: 0.95rem;
  --fs-h1: 1.55rem;
  --fs-h2: 1.25rem;
  --pad-section: 1.75rem;
}

/*
 * Phone stack: 1 column, text above, image below.
 * Applies to real mobile portrait AND Affichage phone presets (data-layout).
 * Container queries make the preview FRAME width drive layout (not the desktop viewport).
 */
.layout-preview-frame {
  container-type: inline-size;
  container-name: yiha-device;
}

/* Shared phone-column rules */
.phone-stack-1col .hero-grid,
.phone-stack-1col .grid-2,
.phone-stack-1col .grid-3,
.phone-stack-1col .media-grid,
.phone-stack-1col .flow-split,
.phone-stack-1col .pay-split,
.phone-stack-1col .detail-grid,
.phone-stack-1col .footer-grid,
.phone-stack-1col .dichotomy-board,
.phone-stack-1col .stats {
  grid-template-columns: 1fr !important;
  gap: 0.85rem;
}
.phone-stack-1col .hero-grid {
  align-items: stretch;
}
/* Explicit order: copy first, media second (text above, image below) */
.phone-stack-1col .hero-grid > :first-child {
  order: 1;
}
.phone-stack-1col .hero-grid > :last-child {
  order: 2;
}
.phone-stack-1col .hero-photo,
.phone-stack-1col .media-card.photo img,
.phone-stack-1col .hero-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.phone-stack-1col .sdg-inline,
.phone-stack-1col .hope-once {
  margin-inline: auto;
  max-width: 140px;
}

/* Real phones: portrait / narrow */
@media (max-width: 480px), (max-width: 900px) and (orientation: portrait) {
  html:not([data-layout]),
  html[data-layout="auto"] {
    /* class applied via body for cascade into children */
  }
  body {
    /* marker class added by JS optional; CSS below uses media alone */
  }
  .hero-grid,
  .grid-2,
  .grid-3,
  .media-grid,
  .flow-split,
  .pay-split,
  .detail-grid,
  .footer-grid,
  .dichotomy-board,
  .stats {
    grid-template-columns: 1fr !important;
  }
  .hero-grid > :first-child { order: 1; }
  .hero-grid > :last-child { order: 2; }
  .hero-photo img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
  }
}

/* Affichage presets that are phone-sized → always stack (even on wide desktop) */
html[data-layout="iphone-portrait"] .hero-grid,
html[data-layout="android-phone"] .hero-grid,
html[data-layout="chinese-phone"] .hero-grid,
html[data-layout="foldable"] .hero-grid,
html[data-layout="iphone-portrait"] .grid-2,
html[data-layout="android-phone"] .grid-2,
html[data-layout="chinese-phone"] .grid-2,
html[data-layout="foldable"] .grid-2,
html[data-layout="iphone-portrait"] .grid-3,
html[data-layout="android-phone"] .grid-3,
html[data-layout="chinese-phone"] .grid-3,
html[data-layout="foldable"] .grid-3,
html[data-layout="iphone-portrait"] .media-grid,
html[data-layout="android-phone"] .media-grid,
html[data-layout="chinese-phone"] .media-grid,
html[data-layout="foldable"] .media-grid,
html[data-layout="iphone-portrait"] .flow-split,
html[data-layout="android-phone"] .flow-split,
html[data-layout="chinese-phone"] .flow-split,
html[data-layout="foldable"] .flow-split,
html[data-layout="iphone-portrait"] .pay-split,
html[data-layout="android-phone"] .pay-split,
html[data-layout="chinese-phone"] .pay-split,
html[data-layout="foldable"] .pay-split,
html[data-layout="iphone-portrait"] .detail-grid,
html[data-layout="android-phone"] .detail-grid,
html[data-layout="chinese-phone"] .detail-grid,
html[data-layout="foldable"] .detail-grid,
html[data-layout="iphone-portrait"] .footer-grid,
html[data-layout="android-phone"] .footer-grid,
html[data-layout="chinese-phone"] .footer-grid,
html[data-layout="foldable"] .footer-grid,
html[data-layout="iphone-portrait"] .dichotomy-board,
html[data-layout="android-phone"] .dichotomy-board,
html[data-layout="chinese-phone"] .dichotomy-board,
html[data-layout="foldable"] .dichotomy-board,
html[data-layout="iphone-portrait"] .stats,
html[data-layout="android-phone"] .stats,
html[data-layout="chinese-phone"] .stats,
html[data-layout="foldable"] .stats {
  grid-template-columns: 1fr !important;
  gap: 0.85rem;
}
html[data-layout="iphone-portrait"] .hero-grid > :first-child,
html[data-layout="android-phone"] .hero-grid > :first-child,
html[data-layout="chinese-phone"] .hero-grid > :first-child,
html[data-layout="foldable"] .hero-grid > :first-child {
  order: 1;
}
html[data-layout="iphone-portrait"] .hero-grid > :last-child,
html[data-layout="android-phone"] .hero-grid > :last-child,
html[data-layout="chinese-phone"] .hero-grid > :last-child,
html[data-layout="foldable"] .hero-grid > :last-child {
  order: 2;
}
html[data-layout="iphone-portrait"] .hero-photo img,
html[data-layout="android-phone"] .hero-photo img,
html[data-layout="chinese-phone"] .hero-photo img,
html[data-layout="foldable"] .hero-photo img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

/* Container queries: frame width triggers phone stack inside Affichage preview */
@container yiha-device (max-width: 480px) {
  .hero-grid,
  .grid-2,
  .grid-3,
  .media-grid,
  .flow-split,
  .pay-split,
  .detail-grid,
  .footer-grid,
  .dichotomy-board,
  .stats {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }
  .hero-grid > :first-child { order: 1; }
  .hero-grid > :last-child { order: 2; }
  .hero-photo img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
  }
  .btn {
    font-size: 0.78rem;
    padding: 0.5rem 0.7rem;
  }
  .section-header h2,
  .hero h1 {
    font-size: 1.15rem;
  }
  .lead {
    font-size: 0.85rem;
  }
}
@container yiha-device (max-width: 900px) {
  .hero-grid,
  .grid-2,
  .media-grid,
  .flow-split,
  .pay-split,
  .dichotomy-board {
    grid-template-columns: 1fr !important;
  }
  .hero-grid > :first-child { order: 1; }
  .hero-grid > :last-child { order: 2; }
}

/* Coarse pointer = finger (phones / tablets) */
@media (pointer: coarse) {
  .lang-switch button,
  .vision-switch button,
  .chip,
  .btn {
    min-height: 44px;
  }
  .activity-card {
    padding: 1rem;
  }
}

/* Prefer reduced data / low-end: skip blur which fails on some WebViews */
@media (max-width: 900px) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }
}

/* —— Fluid layout v1.3.1 —— */
.flow {
  overflow-x: clip;
}
.hero-fluid {
  padding: 3.75rem 0 2.5rem;
}
.flow-band {
  padding: 2.75rem 0;
  position: relative;
}
.flow-band.soft {
  background: linear-gradient(180deg, transparent, rgba(247, 236, 223, 0.55), transparent);
}
.flow-band + .flow-band {
  border-top: 1px solid transparent;
}
.flow-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
.glass {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.glass:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.flow-steps {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
  counter-reset: step;
}
.flow-steps li {
  counter-increment: step;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--ink-soft);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.flow-steps li:hover {
  border-color: var(--brand-mid);
  background: #fff;
}
.flow-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--brand-mid), var(--brand-dark));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.hope-panel {
  text-align: left;
}
.hope-once {
  width: min(140px, 40%);
  height: auto;
  margin: 0 0 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.35rem;
}
.sdg-once {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}
.sdg-once img {
  max-height: 280px;
  width: auto;
  margin: 0 auto 0.75rem;
  transition: transform 0.5s ease;
}
.sdg-once:hover img {
  transform: scale(1.03) rotate(-2deg);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}
.checklist.light li { color: #d5e2ec; }
.checklist.light li::before { color: var(--brand-mid); }

/* Reveal is progressive enhancement only — content ALWAYS visible (fix opacity:0 bug) */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 800;
  vertical-align: middle;
}
.count-pill.muted-pill {
  background: #e8e8e8;
  color: #3d3d3d;
}
.dichotomy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 0 0 1rem;
}

/* —— W3C/WCAG dichotomy board (ongoing vs complete) —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dichotomy-a11y-note {
  margin-bottom: 1rem;
  border-left: 4px solid #1a6bb5;
  background: #f0f6fc;
  color: #1c1610;
  font-size: 0.92rem;
}
.dichotomy-a11y-note p { margin: 0; }
.dichotomy-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}
.dichotomy-col {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.dichotomy-col--ongoing {
  border: 2px solid #7a3410;
  border-top-width: 6px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(122, 52, 16, 0.03) 10px,
      rgba(122, 52, 16, 0.03) 20px
    ),
    #fff;
}
.dichotomy-col--complete {
  border: 2px solid #0b5c3a;
  border-top-width: 6px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(11, 92, 58, 0.03) 10px,
      rgba(11, 92, 58, 0.03) 20px
    ),
    #fff;
}
.dichotomy-col-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.dichotomy-col-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.dichotomy-col-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.dichotomy-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}
.dichotomy-col--ongoing .dichotomy-icon {
  background: #7a3410;
}
.dichotomy-col--complete .dichotomy-icon {
  background: #0b5c3a;
}
.dichotomy-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding-top: 3rem;
}
.dichotomy-divider span {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.activity-grid--stack {
  grid-template-columns: 1fr;
}
.activity-card.status-open {
  border-left: 4px solid #7a3410;
}
.activity-card.status-planning {
  border-left: 4px dashed #312e81;
}
.activity-card.status-complete {
  border-left: 4px solid #0b5c3a;
}
.activity-card:focus {
  outline: none;
}
@media (max-width: 900px) {
  .dichotomy-board {
    grid-template-columns: 1fr;
  }
  .dichotomy-divider {
    padding: 0.25rem 0;
  }
  .dichotomy-divider span {
    width: auto;
    height: auto;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
  }
}
.pay-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Support 3-chapter flow */
.support-stack {
  display: grid;
  gap: 1.25rem;
}
.chapter-num {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
}
.chapter-panel.chapter-blocked {
  opacity: 0.72;
  border-style: dashed;
}
.chapter-panel.chapter-active {
  border-color: var(--brand-mid);
  box-shadow: var(--shadow);
}
.chapter-panel.chapter-done {
  border-color: #0b5c3a;
}
.flow-progress {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.flow-progress li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.flow-progress li span {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #e8e0d4;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.flow-progress li.current {
  border-color: var(--brand-dark);
  color: var(--ink);
  background: var(--brand-soft);
}
.flow-progress li.current span {
  background: var(--brand-dark);
  color: #fff;
}
.flow-progress li.done {
  border-color: #0b5c3a;
  color: #0b5c3a;
}
.flow-progress li.done span {
  background: #0b5c3a;
  color: #fff;
}
.ack-fieldset {
  border: 0;
  margin: 1.15rem 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.ack-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.92rem;
  cursor: pointer;
}
.ack-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--brand-dark);
}
#btn-validate-ack:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.cancel-box {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px dashed var(--line);
}
.cancel-box h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
@media (max-width: 700px) {
  .flow-progress {
    grid-template-columns: 1fr;
  }
}

.wwft-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border-left: 4px solid #1a6bb5;
  background: #f0f6fc;
  color: var(--ink);
}
.wwft-box h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #123a56;
}
.wwft-box p { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.iban-masked-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f4f0ea;
  border: 1px dashed var(--line);
}
.iban-masked code {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.code-lg {
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.unlock-form {
  margin-top: 1.15rem;
  display: grid;
  gap: 0.75rem;
  max-width: 28rem;
}
.unlock-error {
  color: #9b1c1c !important;
  font-weight: 600;
}
.payment-placeholder {
  background: #fff8ef;
  border: 1px dashed var(--brand-mid);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.board-panel {
  margin-top: 0.5rem;
}
.board-panel summary {
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem 0;
}
.board-panel[open] summary {
  margin-bottom: 0.75rem;
}
.board-panel label {
  margin-top: 0.65rem;
}

.activity-clue-box {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}
.activity-clue-box p { margin: 0 0 0.35rem; }
.activity-clue-box p:last-child { margin-bottom: 0; }
.identity-fieldset,
.legal-quiz {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
  margin: 1rem 0;
  background: #fff;
}
.identity-fieldset legend,
.legal-quiz legend {
  padding: 0 0.35rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand-dark);
}
.legal-quiz .ack-check {
  margin-top: 0.55rem;
}
.sdg-inline {
  display: block;
  max-width: 180px;
  margin: 1rem auto 0;
  background: #fff;
  border-radius: 50%;
  padding: 0.35rem;
}
@media (max-width: 900px) {
  .pay-split { grid-template-columns: 1fr; }
}

.activity-card,
.panel,
.hero-photo,
.btn,
.chip,
.nav a {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.activity-card:hover {
  transform: translateY(-4px);
}

.navy-panel {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.navy-panel:hover {
  box-shadow: 0 12px 36px rgba(18, 58, 86, 0.22);
}

@media (max-width: 900px) {
  .flow-split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .activity-card:hover,
  .glass:hover,
  .sdg-once:hover img {
    transform: none;
  }
}

/* ========== Display modes (W3C / visual inclusion) ========== */
/* Applied via html[data-display="…"] — buttons next to language */

/* High contrast — WCAG-oriented black / white / gold */
html[data-display="contrast"] {
  --ink: #000000;
  --ink-soft: #111111;
  --muted: #222222;
  --line: #000000;
  --bg: #ffffff;
  --card: #ffffff;
  --brand: #000000;
  --brand-mid: #000000;
  --brand-dark: #000000;
  --brand-soft: #ffff00;
  --accent: #000000;
  --accent-soft: #ffffcc;
  --navy: #000000;
  --navy-soft: #eeeeee;
  --hope: #000000;
  --hope-soft: #ffff00;
  --shadow: none;
  --shadow-sm: none;
}
html[data-display="contrast"] body {
  background: #fff;
  color: #000;
}
html[data-display="contrast"] .site-header {
  background: #fff;
  border-bottom: 3px solid #000;
}
html[data-display="contrast"] .version-bar {
  background: #000;
  color: #ffff00;
}
html[data-display="contrast"] .btn-primary {
  background: #000 !important;
  color: #ffff00 !important;
  border: 2px solid #000;
  box-shadow: none;
}
html[data-display="contrast"] .btn-secondary {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000;
}
html[data-display="contrast"] .brand-mark {
  background: #000;
  color: #ffff00;
}
html[data-display="contrast"] .navy-panel {
  background: #000;
  color: #ffff00;
}
html[data-display="contrast"] .navy-panel p,
html[data-display="contrast"] .navy-panel a {
  color: #ffff00;
}
html[data-display="contrast"] .activity-card,
html[data-display="contrast"] .panel {
  border: 2px solid #000;
  box-shadow: none;
}
html[data-display="contrast"] .badge-status.open,
html[data-display="contrast"] .badge-status.planning,
html[data-display="contrast"] .badge-status.complete {
  background: #ffff00;
  color: #000;
  border: 2px solid #000;
}
html[data-display="contrast"] .dichotomy-col--ongoing,
html[data-display="contrast"] .dichotomy-col--complete {
  background: #fff;
  border: 3px solid #000;
}
html[data-display="contrast"] a {
  color: #0000ee;
  text-decoration: underline;
}
html[data-display="contrast"] .wwft-box,
html[data-display="contrast"] .dichotomy-a11y-note {
  background: #ffff00;
  border-left: 4px solid #000;
  color: #000;
}

/* Dichromatic / colour-vision safe — blue–orange luminance pairs + patterns */
html[data-display="dichromatic"] {
  --ink: #0d1b2a;
  --ink-soft: #1b2838;
  --muted: #334155;
  --line: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --brand: #0c4a6e;
  --brand-mid: #0369a1;
  --brand-dark: #0c4a6e;
  --brand-soft: #e0f2fe;
  --accent: #c2410c;
  --accent-soft: #ffedd5;
  --navy: #0c4a6e;
  --navy-soft: #e0f2fe;
  --hope: #0369a1;
  --hope-soft: #e0f2fe;
}
html[data-display="dichromatic"] .badge-status.open {
  background: #ffedd5;
  color: #9a3412;
  border: 2px solid #c2410c;
  border-style: dashed;
}
html[data-display="dichromatic"] .badge-status.planning {
  background: #e0f2fe;
  color: #0c4a6e;
  border: 2px solid #0c4a6e;
  border-style: dotted;
}
html[data-display="dichromatic"] .badge-status.complete {
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid #065f46;
}
html[data-display="dichromatic"] .activity-card.status-open {
  border-left: 6px dashed #c2410c;
}
html[data-display="dichromatic"] .activity-card.status-planning {
  border-left: 6px dotted #0c4a6e;
}
html[data-display="dichromatic"] .activity-card.status-complete {
  border-left: 6px solid #065f46;
}
html[data-display="dichromatic"] .dichotomy-col--ongoing {
  border-color: #c2410c;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(194, 65, 12, 0.08) 8px,
    rgba(194, 65, 12, 0.08) 16px
  );
}
html[data-display="dichromatic"] .dichotomy-col--complete {
  border-color: #065f46;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(6, 95, 70, 0.08) 8px,
    rgba(6, 95, 70, 0.08) 16px
  );
}
html[data-display="dichromatic"] .btn-primary {
  background: #0c4a6e !important;
  color: #fff !important;
}
html[data-display="dichromatic"] .version-bar {
  background: linear-gradient(90deg, #0c4a6e, #0369a1);
}

/* Mono / luminance-only — W3C-friendly grayscale high contrast */
html[data-display="mono"] {
  --ink: #000000;
  --ink-soft: #1a1a1a;
  --muted: #333333;
  --line: #444444;
  --bg: #f5f5f5;
  --card: #ffffff;
  --brand: #111111;
  --brand-mid: #333333;
  --brand-dark: #000000;
  --brand-soft: #e5e5e5;
  --accent: #222222;
  --accent-soft: #eeeeee;
  --navy: #111111;
  --navy-soft: #e8e8e8;
  --hope: #111111;
  --hope-soft: #e5e5e5;
}
html[data-display="mono"] body,
html[data-display="mono"] img,
html[data-display="mono"] .hero-photo,
html[data-display="mono"] .panel,
html[data-display="mono"] .activity-card {
  filter: grayscale(1);
}
html[data-display="mono"] .vision-switch,
html[data-display="mono"] .lang-switch {
  filter: none;
}
html[data-display="mono"] .btn-primary {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #000;
}
html[data-display="mono"] .version-bar {
  background: #000;
  color: #fff;
  filter: none;
}
html[data-display="mono"] .badge-status {
  border-width: 2px;
  font-weight: 800;
}

/* Prefer reduced motion still respected in all modes */
@media (prefers-reduced-motion: reduce) {
  html[data-display] * {
    scroll-behavior: auto !important;
  }
}

/* ========== Layout force / device preview ("Affichage") ========== */
.layout-menu {
  position: relative;
  z-index: 60;
}
.layout-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 2.5rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.layout-menu-trigger[aria-expanded="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.layout-menu-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.layout-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: min(20rem, 92vw);
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  z-index: 80;
}
.layout-menu-heading {
  margin: 0.25rem 0.5rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.layout-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 44px;
}
.layout-menu-item:hover,
.layout-menu-item[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.layout-menu-dim {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.layout-menu-foot {
  margin: 0.5rem 0.5rem 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

html.layout-preview-active,
html.layout-preview-active body {
  background: #2a2118 !important;
  min-height: 100%;
}
.layout-preview-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem 1rem;
  box-sizing: border-box;
}
.layout-preview-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  color: #f5ebe0;
  font-size: 0.8rem;
  font-weight: 700;
  background: #1c1610;
  border-radius: 0 0 12px 12px;
}
.layout-preview-badge {
  background: var(--brand-mid, #c4843a);
  color: #1c1610;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
}
.layout-preview-size {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.layout-preview-exit {
  margin-left: auto;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1rem;
  touch-action: manipulation;
}
.layout-preview-frame {
  background: var(--bg, #faf6f0);
  border: 2px solid #4a3f35;
  border-radius: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  margin-top: 0.5rem;
  flex: 0 1 auto;
}

@media (max-width: 900px) {
  .layout-menu {
    flex: 1 1 auto;
  }
  .layout-menu-trigger {
    width: 100%;
    justify-content: center;
  }
  .layout-menu-panel {
    left: 0;
    right: 0;
    min-width: 0;
  }
  #layout-trigger-label {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Beta testing banner (donation protocol) */
.beta-banner {
  margin-bottom: 1.25rem;
  border: 2px dashed var(--brand-dark);
  background: linear-gradient(135deg, #fff8ef, #f7ecdf);
}
.beta-banner .beta-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.1rem;
  color: var(--brand-dark);
}
.beta-banner .chapter-num {
  color: #9a3412;
  letter-spacing: 0.08em;
}
html[data-display="contrast"] .beta-banner {
  background: #ffff00;
  border-color: #000;
  color: #000;
}
@media (max-width: 480px) {
  .beta-banner .beta-title { font-size: 0.95rem; }
  .beta-banner { padding: 0.75rem; font-size: 0.8rem; }
}

.footer-a11y {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #b8a898;
  max-width: 52rem;
}
.footer-a11y p { margin: 0 0 0.4rem; }
.footer-a11y a { color: #f0c090; }
.projects-col-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.labels-chapter .labels-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.labels-chapter .labels-list li {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.labels-chapter .labels-list strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--brand-dark);
  font-size: 0.95rem;
}
.labels-chapter .labels-list span {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.ethics-phases {
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--brand-dark);
}
.ethics-phases h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--brand-dark);
}
.ethics-phase-list {
  margin: 1rem 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.85rem;
}
.ethics-phase-list li {
  padding-left: 0.25rem;
}
.ethics-phase-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 0.95rem;
}
.ethics-phase-list span {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.courage-line {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--brand-dark);
  line-height: 1.45;
}
@media (max-width: 480px) {
  .ethics-phases h2 { font-size: 1rem; }
  .ethics-phase-list strong { font-size: 0.88rem; }
  .ethics-phase-list span { font-size: 0.8rem; }
  .courage-line { font-size: 0.85rem; }
}
