/* EngEthics — ethical engineering consultancy
   Colour charter (blue dominant): primary #2563eb / mid #3b82f6 / deep #1e3a8a */
:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #dbe4f0;
  --bg: #f0f5fb;
  --card: #ffffff;
  /* Brand blue — WCAG AA: use --brand-dark for text/buttons on white */
  --brand: #2563eb;
  --brand-mid: #3b82f6;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --navy: #0f2744;
  --navy-soft: #e8eef6;
  --hope: #3b82f6;
  --hope-soft: #eff6ff;
  --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;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
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 lives in the site footer only — no fixed blue bar. */
.version-bar { display: none !important; }

/* Header — desktop + mobile (iOS notch / Android / Chinese WebViews) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
  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: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
  flex-shrink: 1;
}
.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;
}

/*
 * Main navigation = FULL-VIEWPORT left drawer (ported to <body> in JS).
 * Must NOT stay inside .site-header: backdrop-filter/sticky trap position:fixed
 * into the thin top band (what looked like a ridiculous mini panel).
 * Opened by ☰ right of logo + EngEthics — generous space to encourage browsing.
 */
.nav,
.nav.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  /* Explicit full viewport — never shrink to header band */
  width: min(28rem, 92vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  background: #fff;
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 16px 0 48px rgba(15, 39, 68, 0.22);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  z-index: 200;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
  /* Prevent any ancestor transform/filter from applying (body child) */
  transform: none;
  filter: none;
}
.nav.open,
.nav.nav-drawer.open {
  display: flex;
}
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.nav-drawer-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink, #0f172a);
}
.nav-drawer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
.nav-drawer-close:hover {
  background: var(--brand-soft);
  border-color: var(--brand, #2563eb);
  color: var(--brand-dark);
}
/* Menu items live below the sticky head — generous padding */
.nav > .nav-item,
.nav-drawer > .nav-item {
  flex-shrink: 0;
  padding: 0 0.85rem;
}
.nav > .nav-item:first-of-type,
.nav-drawer > .nav-item:first-of-type {
  margin-top: 0.65rem;
}
.nav > .nav-item:last-child,
.nav-drawer > .nav-item:last-child {
  margin-bottom: 1.5rem;
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 190;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 39, 68, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: none;
  filter: none;
}
.nav-backdrop.is-open {
  display: block;
}
body.nav-drawer-open {
  overflow: hidden !important;
  touch-action: none;
}
/* While open, keep header below the drawer so nothing clips it */
body.nav-drawer-open .site-header {
  z-index: 50;
}
.nav a,
.nav .nav-parent {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.75rem 0.9rem;
  min-height: 48px;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
/* Drawer parents: a trailing • marks a nested tray that can unfold */
.nav .nav-parent[aria-haspopup="true"]::after,
.nav button.nav-parent[aria-haspopup="true"]::after {
  content: "•";
  display: inline;
  margin-left: 0.28rem;
  font-size: 0.85em;
  font-weight: 800;
  line-height: 1;
  opacity: 0.9;
  color: var(--brand, #2563eb);
  vertical-align: baseline;
}
.nav a:hover,
.nav a[aria-current="page"],
.nav .nav-parent:hover,
.nav .nav-parent[aria-current="page"],
.nav-item.open > .nav-parent {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* Drawer accordion: stacked, never right-side flyouts */
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.nav-sub {
  display: none;
  position: static;
  top: auto;
  left: auto;
  min-width: 0;
  max-height: none;
  padding: 0.1rem 0 0.25rem 0.7rem;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  z-index: auto;
  overflow: visible;
  flex-direction: column;
  gap: 0.08rem;
}
.nav-item.open > .nav-sub {
  display: flex;
}
/* Hover-open disabled — drawer is click/tap only (simple + reliable) */
.nav-item:not(.open):hover > .nav-sub,
.nav-item:not(.open):focus-within > .nav-sub {
  display: none;
}
.nav-sub a {
  display: block;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  white-space: normal;
  box-sizing: border-box;
}
/* Leaf and nested-tray items in a drawer: leading dash */
.nav-sub a::before,
.nav-sub .nav-parent-nested::before {
  content: "- ";
  font-weight: 600;
  color: inherit;
}
.nav-sub a:hover,
.nav-sub a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* Nested tool groups stack under parent (no side flyout) */
.nav-sub .nav-item-nested {
  position: relative;
  width: 100%;
}
.nav-sub .nav-parent-nested {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  white-space: normal;
  box-sizing: border-box;
}
.nav-sub .nav-parent-nested[aria-haspopup="true"]::after,
.nav-sub button.nav-parent-nested[aria-haspopup="true"]::after {
  content: "•";
  display: inline;
  margin-left: 0.28rem;
  font-size: 0.85em;
  font-weight: 800;
  line-height: 1;
  opacity: 0.9;
  color: var(--brand, #2563eb);
}
.nav-sub .nav-parent-nested:hover,
.nav-item-nested.open > .nav-parent-nested {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.nav-sub .nav-sub-nested {
  position: static;
  top: auto;
  left: auto;
  min-width: 0;
  max-height: none;
  margin: 0;
  padding: 0.05rem 0 0.2rem 0.7rem;
  box-shadow: none;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.nav-item-nested:not(.open):hover > .nav-sub-nested,
.nav-item-nested:not(.open):focus-within > .nav-sub-nested {
  display: none;
}
.nav-item-nested.open > .nav-sub-nested {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
  z-index: 60;
  margin-left: auto;
}
.lang-switch,
.vision-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  /* Avoid text size inflation quirks on some Chinese Android browsers */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  position: relative;
  z-index: 5;
}
/* vision stays clipped pill; lang must be visible so Autres… panel can open */
.vision-switch {
  overflow: hidden;
}
.lang-switch {
  overflow: visible;
}
.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;
}
/* FR · EN · Autres… — extra languages in dropdown (must not be clipped) */
.lang-switch button[data-lang-more] {
  min-width: auto;
  padding-inline: 0.65rem;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  border-radius: 0 999px 999px 0;
}
.lang-switch > button[data-lang="fr"] {
  border-radius: 999px 0 0 999px;
}
.lang-switch .lang-more-wrap {
  position: relative;
  display: inline-flex;
  z-index: 90;
}
/*
 * Other-languages panel — styles are NOT nested under .lang-switch so they
 * still apply when JS ports the panel to document.body (avoids header
 * backdrop-filter trapping position:fixed and hiding the menu on mobile).
 */
.lang-more-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: auto;
  z-index: 320;
  width: min(22rem, calc(100vw - 1.25rem));
  max-height: min(70vh, 28rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-sizing: border-box;
}
.lang-more-panel[hidden] {
  display: none !important;
}
.lang-more-panel.ee-lang-panel-open {
  position: fixed;
  z-index: 320;
}
.lang-more-panel .lang-panel-hint {
  margin: 0.1rem 0.4rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}
.lang-more-panel .lang-group-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.55rem !important;
  min-width: 0 !important;
  margin: 0;
  padding: 0.5rem 0.75rem !important;
  border-radius: 10px !important;
  border: 1px solid var(--line) !important;
  background: var(--card, #fff) !important;
  color: var(--ink) !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  text-align: left;
  cursor: pointer;
}
.lang-more-panel .lang-group-btn:hover,
.lang-more-panel .lang-group-btn.is-active {
  border-color: var(--brand-mid) !important;
  background: var(--brand-soft) !important;
  color: var(--brand-dark) !important;
}
.lang-more-panel .lang-group-btn-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-dark);
  opacity: 0.85;
}
.lang-more-panel .lang-group-back {
  display: flex !important;
  width: 100%;
  min-height: 2.4rem !important;
  min-width: 0 !important;
  margin-bottom: 0.25rem;
  padding: 0.45rem 0.65rem !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--brand-dark) !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  text-align: left;
  cursor: pointer;
}
.lang-more-panel .lang-group-back:hover {
  background: var(--brand-soft) !important;
}
.lang-more-panel .lang-fallback-tag {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent, #0ea5e9);
  margin-left: 0.25rem;
}
.lang-more-panel .lang-soon-divider {
  height: 1px;
  margin: 0.45rem 0.25rem 0.25rem;
  background: var(--line);
  border: 0;
}
.lang-more-panel .lang-soon-heading {
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.62rem !important;
}
.lang-more-panel .lang-soon-entry {
  border-style: dashed !important;
  background: #f8fafc !important;
}
.lang-more-panel .lang-soon-note {
  margin: 0.25rem 0.4rem 0.15rem;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--muted);
}
.lang-more-panel button[data-lang-soon="1"],
.lang-more-panel button[data-lang][disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.lang-more-panel button[data-lang-soon="1"] .lang-badge {
  background: #e2e8f0;
  color: #64748b;
}
/* Toast when language UI falls back to English body text */
.ee-lang-notice {
  position: fixed;
  left: 50%;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 120;
  width: min(36rem, calc(100vw - 1.5rem));
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f2744;
  color: #f0f7ff;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}
.ee-lang-notice strong {
  color: #fff;
}
.ee-lang-notice[hidden] {
  display: none !important;
}
.ee-lang-notice--partial {
  background: #1e3a5f;
  border-color: #3b82f6;
}
.ee-lang-notice-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  justify-content: space-between;
}
.ee-lang-notice-dismiss {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.ee-lang-notice-dismiss:hover {
  background: rgba(255, 255, 255, 0.22);
}
.lang-more-panel button[data-lang] {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  border-radius: 8px;
  text-align: left;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  line-height: 1.25;
  border: 0;
  cursor: pointer;
}
.lang-more-panel button[data-lang] .lang-badge {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.lang-more-panel button[data-lang] .lang-native {
  grid-column: 2;
  font-weight: 700;
}
.lang-more-panel button[data-lang] .lang-en,
.lang-more-panel button[data-lang] small {
  grid-column: 2;
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0;
}
.lang-more-panel button[data-lang][aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.lang-more-panel button[data-lang][aria-pressed="true"] .lang-badge {
  background: var(--brand-dark);
  color: #fff;
}
.lang-switch.lang-more-open button[data-lang-more] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.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,
.nav .nav-parent: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;
}
/* ☰ always visible — immediately right of logo + EngEthics text */
.menu-toggle {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
  touch-action: manipulation;
  padding: 0;
}
.menu-toggle:hover {
  background: var(--brand-soft);
  border-color: var(--brand, #2563eb);
  color: var(--brand-dark);
}
.menu-toggle[aria-expanded="true"] {
  background: var(--brand-soft);
  border-color: var(--brand, #2563eb);
  color: var(--brand-dark);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* 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;
  width: 100%;
  max-width: 100%;
  /* Home hero JPG is 1621×2160 — freeze natural ratio (not invented) */
  aspect-ratio: var(--media-ar, 1621 / 2160);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: var(--media-fit, cover);
  object-position: center;
  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 frames: natural JPG ratio on container + object-fit on img ——
 * Mobile: width follows the screen; height follows the frozen ratio (no stretch).
 */
.media-frame {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius, 14px);
  background: var(--media-bg, #e8eef4);
  /* --media-ar set per image from measured pixels */
  aspect-ratio: var(--media-ar, 3 / 2);
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(15, 39, 68, 0.08));
}
.media-frame > img,
.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: var(--media-fit, cover);
  object-position: var(--media-pos, center);
}
.media-frame > figcaption,
.media-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.8rem;
  background: linear-gradient(transparent, rgba(28, 22, 16, 0.72));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0;
}
/* Fit modes */
.media-frame--cover { --media-fit: cover; }
.media-frame--contain { --media-fit: contain; }
/* Measured natural ratios (pixel sizes of source files) */
.media-frame--iceberg { --media-ar: 1024 / 1536; } /* adaptation iceberg 2:3 */
.media-frame--hero-home { --media-ar: 1621 / 2160; } /* index/about hero */
.media-frame--3-2 { --media-ar: 3 / 2; } /* 1536×1024 retrofit etc. */
.media-frame--2-3 { --media-ar: 2 / 3; }
.media-frame--3-4 { --media-ar: 3 / 4; } /* 1920×2560 monitor */
.media-frame--16-9 { --media-ar: 16 / 9; } /* 1280×720 Clipperton */
.media-frame--splash { --media-ar: 1168 / 784; } /* EE generated splash */
.media-frame--budapest { --media-ar: 1950 / 1235; } /* 30:19 castle night */
.media-frame--drilling { --media-ar: 1733 / 1389; } /* Yibal programme */
.media-frame--unsplash-heat { --media-ar: 1600 / 1067; }
.media-frame--unsplash-mentor { --media-ar: 1600 / 1060; }
.media-frame--mlc-wallet { --media-ar: 760 / 1050; --media-bg: #f4f1ea; }
.media-frame--mlc-employer { --media-ar: 635 / 627; --media-bg: #f6f3ee; }
/* Ch.17 hypothetical screens: large on desktop; 17.3 fills the phone */
.mlc-fig {
  margin: 1rem 0;
  overflow: hidden;
}
.mlc-fig-wallet {
  max-width: 44rem;
  margin-inline: auto;
}
.mlc-fig-employer {
  max-width: 46rem;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .mlc-fig-wallet {
    max-width: none;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
  }
  .mlc-fig-wallet .media-frame {
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
  }
  .mlc-fig-employer {
    max-width: none;
  }
}
html[data-layout="iphone-portrait"] .mlc-fig-wallet,
html[data-layout="android-phone"] .mlc-fig-wallet,
html[data-layout="chinese-phone"] .mlc-fig-wallet,
html[data-layout="foldable"] .mlc-fig-wallet {
  max-width: none;
  width: 100%;
  margin-inline: 0;
  border-radius: 0;
}
html[data-layout="iphone-portrait"] .mlc-fig-wallet .media-frame,
html[data-layout="android-phone"] .mlc-fig-wallet .media-frame,
html[data-layout="chinese-phone"] .mlc-fig-wallet .media-frame,
html[data-layout="foldable"] .mlc-fig-wallet .media-frame {
  border-radius: 0;
}
html[data-layout="iphone-portrait"] .mlc-fig-employer,
html[data-layout="android-phone"] .mlc-fig-employer,
html[data-layout="chinese-phone"] .mlc-fig-employer,
html[data-layout="foldable"] .mlc-fig-employer {
  max-width: none;
}
/* Panel / figure wrappers that already have .panel */
.panel.media-frame,
figure.media-frame {
  padding: 0;
}
/* Dossier: splash inside figure.panel — frame fills panel width, caption below */
figure.panel > .media-frame {
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}
figure.panel > figcaption.muted {
  position: static;
  background: transparent;
  color: var(--muted, #64748b);
  padding: 0.55rem 0.85rem;
}
/* Dossier splash figures (drilling, mlc, city-scan…) */
.hero .media-frame,
.hero figure.media-frame {
  margin-top: 0.25rem;
}
/* Iceberg / contain: soft letterbox when box ≠ crop */
.media-frame--contain {
  --media-fit: contain;
  --media-bg: #0b1c2c;
}
.media-frame--iceberg {
  --media-bg: #0a1620;
}
.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;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}
.media-card.photo {
  /* photo cards: frame holds ratio, img covers */
  padding-bottom: 0.85rem;
}
.media-card.photo .media-frame {
  margin-bottom: 0.85rem;
  border-radius: 10px;
}
.media-card.photo img {
  width: 100%;
  height: 100%;
  max-height: none;
  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;
  align-items: stretch;
}

/* Founder: PM hub + satellite toolkit (desktop tree, column on phone) */
.founder-orbit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.founder-orbit .panel { margin-top: 0; }
.founder-sats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}
.founder-spine {
  display: block;
  width: 100%;
  height: 22px;
  overflow: visible;
}
.founder-spine line {
  stroke: var(--brand, #2563eb);
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.founder-hub {
  width: min(100%, 34rem);
  margin: 0 auto;
  background: linear-gradient(160deg, var(--brand-soft, #dbeafe), #fff);
  border: 2px solid var(--brand, #2563eb);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.founder-hub-kicker,
.founder-sat-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand, #2563eb);
}
.founder-sat {
  position: relative;
  border-top: 3px solid var(--brand, #2563eb);
}
.founder-sat h3,
.founder-hub h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.founder-sat p:not(.founder-sat-kicker),
.founder-hub p:not(.founder-hub-kicker) {
  margin: 0;
  font-size: 0.9rem;
}
@media (max-width: 800px) {
  .founder-orbit { display: flex; flex-direction: column; gap: 0.75rem; }
  .founder-sats { display: contents; }
  .founder-spine { display: none; }
  .founder-hub { width: 100%; order: -1; text-align: left; }
}

/* Tools page: equal-height cards, CTA pinned to bottom (desktop) */
body[data-page="tools"] .grid-3 > .panel,
body[data-page="tools"] .grid-3 > .tool-card { position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 11.25rem;
}
body[data-page="tools"] .grid-3 > .panel > p,
body[data-page="tools"] .grid-3 > .tool-card > p:not(.cta-row) {
  flex: 1 1 auto;
  overflow-wrap: break-word;
  hyphens: auto;
  margin-bottom: 1rem;
}
body[data-page="tools"] .grid-3 > .panel > .btn,
body[data-page="tools"] .grid-3 > .panel > .cta-row,
body[data-page="tools"] .grid-3 > .tool-card > .btn,
body[data-page="tools"] .grid-3 > .tool-card > .cta-row {
  margin-top: auto;
}
body[data-page="tools"] .grid-3 > .panel > .cta-row {
  flex-direction: column;
  align-items: flex-start;
}

/* 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 var(--brand);
}
.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; }
  .founder-orbit { display: flex; flex-direction: column; gap: 0.75rem; }
  .founder-sats { display: contents; }
  .founder-spine { display: none; }
  .founder-hub { width: 100%; order: -1; text-align: left; }
  .stats { grid-template-columns: 1fr; }
  .hope-watermark { float: none; display: block; margin: 0 auto 1rem; }
  /* Left drawer already used at all widths — keep phone header compact */
  .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: 5;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
    margin-left: 0;
  }
  .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.58rem;
    padding-top: 0.14rem;
    padding-bottom: max(0.14rem, env(safe-area-inset-bottom, 0px));
  }
  .version-bar .container {
    gap: 0.25rem 0.45rem;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* 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.55rem;
    padding: 0.12rem 0;
    padding-bottom: max(0.12rem, env(safe-area-inset-bottom, 0px));
  }
  /* Slim single-line: badge + truncated last-change notes */
  .version-bar .container > span:first-child .muted-on-dark {
    display: none;
  }
  .version-bar .muted-on-dark[data-version-notes] {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.52rem;
    line-height: 1.25;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .version-badge {
    font-size: 0.52rem;
    padding: 0.02rem 0.32rem;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .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,
  .nav .nav-parent {
    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: ee-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-frame,
.phone-stack-1col .media-card.photo .media-frame {
  width: 100%;
  max-width: 100%;
  /* height from frozen aspect-ratio — never clamp with max-height */
  max-height: none;
}
.phone-stack-1col .hero-photo img,
.phone-stack-1col .media-frame img,
.phone-stack-1col .media-card.photo img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: var(--media-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,
  .media-frame {
    width: 100%;
    max-height: none;
  }
  .hero-photo img,
  .media-frame img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: var(--media-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,
html[data-layout="android-phone"] .hero-photo,
html[data-layout="chinese-phone"] .hero-photo,
html[data-layout="foldable"] .hero-photo,
html[data-layout="iphone-portrait"] .media-frame,
html[data-layout="android-phone"] .media-frame,
html[data-layout="chinese-phone"] .media-frame,
html[data-layout="foldable"] .media-frame {
  width: 100%;
  max-height: none;
}
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,
html[data-layout="iphone-portrait"] .media-frame img,
html[data-layout="android-phone"] .media-frame img,
html[data-layout="chinese-phone"] .media-frame img,
html[data-layout="foldable"] .media-frame img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: var(--media-fit, cover);
}

/* Container queries: frame width triggers phone stack inside Affichage preview */
@container ee-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,
  .media-frame {
    width: 100%;
    max-height: none;
  }
  .hero-photo img,
  .media-frame img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: var(--media-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 ee-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: var(--ink);
  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,
.nav .nav-parent {
  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;
}
/* Panel may be ported to body (class ee-layout-panel-open) — styles not limited to .layout-menu */
.layout-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: min(20rem, 92vw);
  width: min(20rem, calc(100vw - 1.25rem));
  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: 320;
  box-sizing: border-box;
}
.layout-menu-panel[hidden] {
  display: none !important;
}
.layout-menu-panel.ee-layout-panel-open {
  position: fixed;
  z-index: 320;
}
.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: var(--ink);
  border-radius: 0 0 12px 12px;
}
.layout-preview-badge {
  background: var(--brand-mid);
  color: var(--ink);
  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);
  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-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; }

/* —— Indicative results disclaimer (home bottom, about, EECM) —— */
.ee-disclaimer {
  margin: 0 auto 1.25rem;
  max-width: var(--max, 72rem);
  width: min(100% - 2rem, var(--max, 72rem));
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(154, 100, 48, 0.35);
  background: linear-gradient(135deg, #fff8f0 0%, #f5f0e8 55%, #eef4fb 100%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  color: var(--ink-soft, #2a3340);
}
.ee-disclaimer-label {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  background: #7c2d12;
  color: #fff7ed;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
}
.ee-disclaimer-short {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-dark, #1d4ed8);
}
.ee-disclaimer-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink, #0f172a);
  line-height: 1.3;
}
.ee-disclaimer-body {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-soft, #334155);
  max-width: 58rem;
}
.ee-disclaimer--compact {
  padding: 0.55rem 0.75rem;
  background: rgba(255, 248, 240, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  color: #e8e0d4;
  width: 100%;
  max-width: none;
  margin: 0.75rem 0 0;
}
.ee-disclaimer--compact .ee-disclaimer-short {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f0c090;
}
.ee-disclaimer--compact .ee-disclaimer-title,
.ee-disclaimer--compact .ee-disclaimer-body {
  display: none;
}
.site-footer .ee-disclaimer--compact {
  border-color: rgba(255, 255, 255, 0.12);
}
@media (max-width: 480px) {
  .ee-disclaimer {
    padding: 0.7rem 0.75rem;
  }
  .ee-disclaimer-title {
    font-size: 0.88rem;
  }
  .ee-disclaimer-body {
    font-size: 0.72rem;
  }
}
html[data-display="contrast"] .ee-disclaimer {
  background: #fff;
  border: 2px solid #000;
  color: #000;
}
html[data-display="contrast"] .ee-disclaimer-short {
  color: #000;
}
html[data-display="mono"] .ee-disclaimer {
  background: #f0f0f0;
  border-color: #000;
}
.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; }
}

/* EngEthics form + a11y helpers */
.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;
}
.brand-mark img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
form label { display: block; margin-bottom: 0.85rem; font-weight: 600; font-size: var(--fs-small); color: var(--ink-soft); }
form label span { display: block; margin-bottom: 0.35rem; }
form input, form textarea, form select {
  width: 100%; font: inherit; padding: 0.65rem 0.75rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
form input:focus, form textarea:focus { outline: 2px solid var(--brand-mid); outline-offset: 1px; border-color: var(--brand); }


/* vision 5-btn (Auto + EE + HC + DI + BW) */
.vision-switch button {
  font-size: 0.68rem;
  padding: 0.35rem 0.4rem;
  min-width: 2rem;
}
.layout-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: min(70vh, 420px);
  overflow: auto;
}


/* cop-chart v1.1 */
.cop-chart { padding: 1rem 1.1rem 1.4rem; }
.cop-category { margin-bottom: 1.15rem; border-left: 4px solid var(--cat, var(--brand)); padding-left: 0.75rem; }
.cop-cat-title { margin: 0 0 0.55rem; font-size: 0.95rem; color: var(--navy); }
.cop-row { display: grid; grid-template-columns: minmax(8rem, 34%) 1fr; gap: 0.45rem 0.75rem; align-items: center; margin-bottom: 0.4rem; }
.cop-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
.cop-track { position: relative; height: 1.55rem; background: linear-gradient(90deg, #fee2e2 0 12.5%, #fef9c3 12.5% 18.75%, #dcfce7 18.75% 37.5%, #ede9fe 37.5% 100%); border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.cop-bar { position: absolute; top: 3px; bottom: 3px; background: var(--cat, var(--brand)); border-radius: 6px; opacity: 0.92; min-width: 4px; }
.cop-bar--pvt { background: linear-gradient(90deg, #ea580c, #fbbf24); box-shadow: 0 0 0 2px #fff inset; }
.cop-row--highlight {
  background: rgba(234, 88, 12, 0.08);
  border-radius: 8px;
  padding: 0.25rem 0.35rem;
  margin-left: -0.35rem;
  margin-right: -0.35rem;
}
.doc-table tr.cop-row--highlight td {
  background: rgba(234, 88, 12, 0.1);
  font-weight: 600;
}
.cop-vals { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); font-size: 0.68rem; font-weight: 700; color: var(--ink); text-shadow: 0 0 4px #fff; }
.cop-axis { position: relative; height: 1.2rem; margin: 0.35rem 0 0 34%; font-size: 0.65rem; color: var(--muted); }
.cop-axis span { position: absolute; transform: translateX(-50%); }
.pvt-callout { border: 2px solid #ea580c; background: #fff7ed; }
.pvt-callout h2 { color: #c2410c; }
.index-levels { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.index-levels li { margin: 0.25rem 0; font-size: 0.88rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
@media (max-width: 700px) {
  .cop-row { grid-template-columns: 1fr; }
  .cop-axis { margin-left: 0; }
}


/* adaptation hub — iceberg + cards keep natural ratios */
.adapt-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: center;
}
.adapt-hero-grid .media-frame--iceberg {
  /* 1024×1536 → 2:3; width fluid, height from ratio */
  max-width: min(100%, 28rem);
  margin-inline: auto;
  box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.08));
}
.adapt-after-iceberg {
  padding-top: 2.75rem;
}
.adapt-card-p21 {
  max-width: 44rem;
  margin: 0 auto 2.25rem;
}
.adapt-hero-grid img:not(.media-frame img) {
  width: 100%;
  height: auto;
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.08));
}
.adapt-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.adapt-card .media-frame,
.adapt-card img.key-visual {
  width: 100%;
  max-height: none;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}
.adapt-card img.key-visual {
  /* Prefer frame wrapper; standalone img still uses natural ratio via attrs + cover box */
  height: auto;
  aspect-ratio: var(--media-ar, 3 / 2);
  object-fit: cover;
  background: #e8f5c8;
  display: block;
}
@media (max-width: 800px) {
  .adapt-hero-grid, .adapt-split { grid-template-columns: 1fr; }
  .adapt-hero-grid .media-frame--iceberg {
    max-width: 100%;
  }
  .adapt-after-iceberg {
    padding-top: 2rem;
  }
}

/* Tool / project cards: key visual = natural splash ratio */
.tool-card > .media-frame,
.tool-card > img.key-visual,
.panel.tool-card > img.key-visual {
  width: 100%;
  max-height: none;
  border-radius: 10px 10px 0 0;
  display: block;
}
.tool-card > img.key-visual {
  height: auto;
  aspect-ratio: var(--media-ar, 1168 / 784);
  object-fit: cover;
  margin: 0;
}


/* index diagrams */
.index-diagram {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 12px;
  margin: 0.65rem 0 0.85rem;
  padding: 0.35rem;
}
.index-actions {
  margin-top: 0.85rem;
  flex-wrap: wrap;
  gap: 0.45rem;
}


/* ee-ref-code — discrete 4-digit map id */
.ee-ref-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted, #64748b);
  opacity: 0.55;
  user-select: all;
}
.ee-ref-code:hover { opacity: 0.95; color: var(--brand, #2563eb); }
.site-footer .ee-ref-code,
.footer-version .ee-ref-code {
  margin-left: 0.5rem;
}
.site-tree pre {
  font-size: 0.78rem;
  line-height: 1.35;
  overflow: auto;
  background: var(--card, #fff);
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  max-height: 70vh;
}
.site-tree .code {
  color: var(--brand, #2563eb);
  font-weight: 700;
}
.site-tree a.tree-link {
  color: inherit;
  text-decoration: none;
}
.site-tree a.tree-link:hover {
  color: var(--brand, #2563eb);
  text-decoration: underline;
}
.site-tree a.tree-path {
  opacity: 0.55;
}
.site-tree a.tree-path:hover {
  opacity: 1;
}

/* ——— Carbon tools + ISO 14064 + section comment tags ——— */
.carbon-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
}
.carbon-tool-card .cta-row {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.carbon-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand, #2563eb);
  background: var(--soft, #eff6ff);
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

/* "New!" tag — e.g. next to E.03 Open tool GC-EECM */
.nav-link-new {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ee-tag-new {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #ea580c);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35);
  vertical-align: middle;
  white-space: nowrap;
}
.btn .ee-tag-new,
.btn-primary .ee-tag-new {
  background: #fff;
  color: #c2410c;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.85);
}
.nav-sub .ee-tag-new {
  font-size: 0.58rem;
  padding: 0.1rem 0.38rem;
}
html[data-display="contrast"] .ee-tag-new {
  background: #000;
  color: #ffff00;
  border: 1px solid #000;
}
html[data-display="mono"] .ee-tag-new {
  background: #111;
  color: #fff;
}
.doc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.doc-toc a {
  text-decoration: none;
  color: var(--navy, #0f2744);
  font-weight: 600;
}
.doc-toc a:hover { color: var(--brand, #2563eb); }
.doc-section {
  scroll-margin-top: 5.5rem;
  margin-top: 1.25rem;
}
.doc-section > .panel { position: relative; }
.comment-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.comment-heading-row > :first-child { flex: 1 1 12rem; margin: 0; }
.comment-tag-chrome {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  max-width: min(100%, 22rem);
}
.comment-tag-chip {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand, #2563eb);
  background: var(--soft, #eff6ff);
  border: 1px dashed var(--brand, #2563eb);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
  line-height: 1.2;
}
.comment-tag-chip:hover,
.comment-tag-chip[aria-expanded="true"] {
  background: var(--brand, #2563eb);
  color: #fff;
  border-style: solid;
}
.comment-tag-chip--locked {
  border-style: solid;
  border-color: var(--muted, #94a3b8);
  color: var(--muted, #64748b);
  background: var(--bg, #f8fafc);
  cursor: pointer;
}
.comment-tag-chip--locked:hover,
.comment-tag-chip--locked[aria-expanded="true"] {
  background: var(--soft, #eff6ff);
  color: var(--navy, #0f2744);
  border-color: var(--brand, #2563eb);
}
.comment-panel--locked .comment-locked-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--soft, #eff6ff);
  border: 1px solid var(--line, #dbe4f0);
}
.comment-panel--locked .comment-locked-banner p {
  margin: 0.2rem 0;
  font-size: 0.88rem;
}
.doc-table-group td {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand, #2563eb);
  background: var(--soft, #eff6ff);
  padding-top: 0.55rem;
  padding-bottom: 0.45rem;
}
.partner-gate-notice {
  max-width: 48rem;
}
.partner-gate-notice code {
  font-size: 0.85em;
}
.comment-panel {
  width: min(100vw - 2rem, 22rem);
  background: var(--card, #fff);
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 39, 68, 0.12);
  padding: 0.75rem;
  z-index: 5;
}
.comment-list {
  max-height: 12rem;
  overflow: auto;
  margin-bottom: 0.65rem;
  display: grid;
  gap: 0.55rem;
}
.comment-item {
  background: var(--bg, #f0f5fb);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.comment-meta {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  margin-bottom: 0.25rem;
}
.comment-body {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.comment-empty { font-size: 0.85rem; margin: 0.25rem 0; }
.comment-form { display: grid; gap: 0.45rem; }
.comment-label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy, #0f2744);
}
.comment-label input,
.comment-label textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: inherit;
}
.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}
.comment-hint { font-size: 0.72rem; margin: 0.15rem 0 0; }
.doc-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-top: 0.75rem;
}
.table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--line, #dbe4f0);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.doc-table th {
  background: var(--soft, #eff6ff);
  color: var(--navy, #0f2744);
  font-weight: 700;
}
.doc-callout {
  border-left: 4px solid var(--brand, #2563eb);
  background: var(--soft, #eff6ff);
  padding: 0.75rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 0.85rem 0;
}
.doc-list-tight { margin: 0.5rem 0 0.75rem; padding-left: 1.2rem; }
.doc-list-tight li { margin: 0.35rem 0; }
.muted { color: var(--muted, #64748b); }

/* MenuMap */
.menu-map-kind {
  color: var(--brand, #2563eb);
  font-weight: 900;
  display: inline-block;
  min-width: 0.9rem;
  text-align: center;
  font-size: 1.15em;
  line-height: 1;
}
.menu-map-link {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  text-decoration: none;
  word-break: break-all;
}
.menu-map-link:hover { color: var(--brand, #2563eb); text-decoration: underline; }
.menu-map-note { opacity: 0.65; font-size: 0.72rem; }
.menu-map-root { font-weight: 800; color: var(--navy, #0f2744); }

/* Left-drawer nav: mega / side-flyout desktop rules retired — accordion only */

.ethics-dossier-icon {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  max-width: 36rem;
}
.ethics-dossier-icon img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.ethics-dossier-icon span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ethics-dossier-icon small {
  opacity: 0.7;
  font-size: 0.82rem;
}
.ethics-dossier-icon:hover {
  border-color: var(--brand, #2563eb);
  color: var(--brand, #2563eb);
}

.menu-map-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand, #2563eb);
  letter-spacing: 0.02em;
}
.menu-map-name {
  color: inherit;
  text-decoration: none;
}
.menu-map-name:hover { color: var(--brand, #2563eb); text-decoration: underline; }

/* —— LTkr (Last Tracker) —— */
.ltkr-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.ltkr-prio-info {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #94a3b8;
}
.ltkr-prio-base {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.ltkr-prio-important {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}
.ltkr-prio-critical {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.ltkr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ltkr-table th,
.ltkr-table td {
  border-bottom: 1px solid var(--line, #e2e8f0);
  padding: 0.55rem 0.45rem;
  text-align: left;
  vertical-align: top;
}
.ltkr-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.ltkr-muted {
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.ltkr-status {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--muted, #64748b);
}
.ltkr-agenda {
  margin: 0;
  padding-left: 1.2rem;
}
.ltkr-agenda li {
  margin: 0.45rem 0;
}
.ltkr-mom {
  margin-bottom: 0.75rem;
}
.ltkr-var {
  margin-bottom: 0.65rem;
  padding: 0.75rem 0.9rem;
}
.ltkr-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0.75rem 0 1rem;
}
.ltkr-count {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}
.ltkr-count strong {
  color: var(--fg, #0f172a);
  font-size: 1.05rem;
}
.ltkr-prio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.ltkr-reasons {
  columns: 1;
}
@media (min-width: 720px) {
  .ltkr-reasons {
    columns: 2;
    column-gap: 1.5rem;
  }
}
.ltkr-reasons li {
  break-inside: avoid;
  margin: 0.35rem 0;
}
.tool-num {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand, #1d4ed8);
  margin-right: 0.35rem;
}

/* LTkr app (operational workspace) */
.ltkr-app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.ltkr-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.4rem 0;
  font-size: 0.85rem;
}
.ltkr-field.full { grid-column: 1 / -1; }
.ltkr-field span { color: var(--muted, #64748b); font-size: 0.75rem; font-weight: 600; }
.ltkr-field input,
.ltkr-field textarea,
.ltkr-edit-table input,
.ltkr-edit-table select {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  background: var(--bg, #fff);
  color: var(--fg, #0f172a);
  width: 100%;
  min-width: 0;
}
.ltkr-edit-table .ltkr-input-sm { width: 4rem; }
.ltkr-btn-sm { padding: 0.2rem 0.45rem !important; min-height: 0 !important; font-size: 0.8rem !important; }
.ltkr-progress-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.ltkr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  border-radius: 999px;
}
.ltkr-cap {
  border-left: 4px solid #1d4ed8;
  background: #eff6ff;
  padding: 0.75rem 1rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.ltkr-cap strong { color: #1e3a8a; }
.ltkr-scroll { overflow-x: auto; }
.ltkr-app-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .ltkr-app-grid-2 { grid-template-columns: 1fr 1fr; }
}

.tool-soon-tag,
.nav-soon {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.nav-soon {
  margin: 0.25rem 0.5rem;
  opacity: 0.9;
  pointer-events: none;
}
.tool-card--soon {
  position: relative;
  opacity: 0.98;
}
.ltkr-soon-mask .carbon-badge {
  font-size: 0.85rem;
}

/* Padlocked dossier sections (preview titles; body in PDF until unlock) */
.doc-section--locked {
  position: relative;
  opacity: 0.92;
  border-style: dashed !important;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
}
.doc-lock-banner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.doc-lock-banner .ee-padlock { font-size: 0.95rem; }
.ee-padlock { display: inline; }
.doc-section--locked .doc-locked-teaser {
  color: var(--muted, #64748b);
  font-style: italic;
}
.doc-section--locked .doc-locked-outline {
  opacity: 0.75;
  pointer-events: none;
  user-select: none;
}
.doc-section--locked .doc-locked-outline li {
  filter: blur(0.2px);
}
.doc-toc .ee-padlock { font-size: 0.75em; opacity: 0.85; }

/* ——— Arabic RTL (html[dir=rtl] set by js/i18n.js) ——— */
html[dir="rtl"] {
  --font: "Segoe UI", Tahoma, "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", "Arial", system-ui, sans-serif;
}
html[dir="rtl"] body {
  font-family: var(--font);
}
html[dir="rtl"] .nav.nav-drawer,
html[dir="rtl"] .nav {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 48px rgba(15, 39, 68, 0.22);
  padding-left: 0;
  padding-right: env(safe-area-inset-right, 0px);
}
html[dir="rtl"] .nav a,
html[dir="rtl"] .nav .nav-parent,
html[dir="rtl"] .nav-sub .nav-parent-nested,
html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: start;
}
html[dir="rtl"] .nav .nav-parent[aria-haspopup="true"]::after,
html[dir="rtl"] .nav button.nav-parent[aria-haspopup="true"]::after,
html[dir="rtl"] .nav-sub .nav-parent-nested[aria-haspopup="true"]::after {
  margin-left: 0;
  margin-right: 0.28rem;
}
html[dir="rtl"] .nav-sub,
html[dir="rtl"] .nav-sub .nav-sub-nested {
  padding-left: 0;
  padding-right: 0.7rem;
}
html[dir="rtl"] .quote,
html[dir="rtl"] .ethics-phases,
html[dir="rtl"] .doc-callout {
  border-left: none;
  border-right: 4px solid var(--brand-dark, var(--brand));
  border-radius: var(--radius) 0 0 var(--radius);
}
html[dir="rtl"] .ethics-phase-list {
  padding-left: 0;
  padding-right: 1.2rem;
}
html[dir="rtl"] .founder-hub {
  text-align: start;
}
