/* Base Container Setup */
  .tenki-funnel-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background-color: #F8F9FA;
    border-radius: 12px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    box-shadow: 0 8px 25px rgba(0,0,0,0.02);
    position: relative;
  }

  .tenki-funnel-container *,
  .tenki-funnel-container *::before,
  .tenki-funnel-container *::after {
    box-sizing: inherit;
  }

  /* Build chip — hidden by default, shown only on ?debug=1.  The shared
     showBuildChip() script (added inline below) flips it on. */
  .tenki-funnel-build-chip {
    position: absolute; top: 8px; right: 12px;
    font-size: 10px; font-family: ui-monospace, SFMono-Regular, monospace;
    color: #6b7280; background: #fff; padding: 2px 6px; border-radius: 4px;
    border: 1px solid #e5e7eb; display: none;
  }
  .tenki-funnel-container.show-build .tenki-funnel-build-chip { display: inline-block; }

  /* Funnel Header Structure */
  .funnel-header {
    text-align: center;
    margin-bottom: 30px;
  }

  /* Logo banner — respects the Tenki mark's natural 3:1 aspect ratio
     (1536 × 512 source).  No inner padding since the new logo already
     has its own black background + green rounded border baked in, so
     it fills the box edge-to-edge.  object-fit:contain prevents any
     distortion if the underlying asset's aspect ratio is ever swapped. */
  .funnel-logo-box {
    position: relative;
    width: clamp(180px, 24vw, 240px);
    aspect-ratio: 3 / 1;
    margin: 0 auto 14px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    isolation: isolate;            /* contain z-index stack */
  }
  .funnel-logo-box img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  /* ── Sierra-Leone flag backdrop (hint layer) ──────────────────────
     The original Tenki mark didn't show its SL-flag-color heritage so
     we drew a fluttering green/white/blue banner behind it for
     ambience.  The NEW mark bakes those colors directly into the
     letters (green T-e, white n, blue ki) on a solid black ground,
     so the banner behind it is mostly hidden.  Kept at very low
     opacity as a hint layer that peeks around if a future logo asset
     uses transparency — invisible otherwise.  Trivial to crank back
     up to 0.18 if you ever want the flag to read through the logo. */
  .funnel-flag-bg {
    position: absolute;
    inset: -10%;
    z-index: 1;
    background: linear-gradient(
      to bottom,
      #1eb53a 0%,    #1eb53a 33.3%,
      #ffffff 33.3%, #ffffff 66.6%,
      #0072c6 66.6%, #0072c6 100%
    );
    opacity: 0.08;                 /* faint hint — logo's bg covers it */
    filter: blur(0.8px);
    transform-origin: center;
    animation: tenkiFlagFlutter 7s ease-in-out infinite;
    pointer-events: none;
  }
  /* Tiny shear + scale loop simulates fabric sway.  Kept under ±2°
     and ±1.5% so it's "subtle" — not a swinging banner. */
  @keyframes tenkiFlagFlutter {
    0%   { transform: skewX(-1.5deg) skewY(0.3deg) scale(1.015); }
    25%  { transform: skewX( 0.8deg) skewY(-0.4deg) scale(1.008); }
    50%  { transform: skewX( 1.6deg) skewY(0.5deg) scale(1.020); }
    75%  { transform: skewX(-0.4deg) skewY(-0.3deg) scale(1.010); }
    100% { transform: skewX(-1.5deg) skewY(0.3deg) scale(1.015); }
  }
  /* Honor the user's reduced-motion preference — flag stays static */
  @media (prefers-reduced-motion: reduce) {
    .funnel-flag-bg { animation: none; }
  }

  .funnel-header h2 {
    color: #1A1A1A;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    font-weight: 800;
  }

  .funnel-header-divider {
    width: 50px;
    height: 4px;
    background-color: #008C45;
    margin: 0 auto 15px auto;
    border-radius: 2px;
  }

  .funnel-intro {
    color: #555555;
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
  }

  .funnel-inline-link {
    color: #005A9C;
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.2s ease;
  }

  .funnel-inline-link:hover {
    color: #008C45;
  }

  /* Grid Layout mechanics */
  .funnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
  }

  /* Compact Card Rules */
  .funnel-card {
    background-color: #FFFFFF;
    border-radius: 10px;
    padding: 24px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    border-top: 5px solid #1A1A1A;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  }

  /* Theme Mapping */
  .card-blue-track {
    border-top-color: #005A9C;
    background: linear-gradient(180deg, rgba(0, 90, 156, 0.03) 0%, rgba(255, 255, 255, 1) 120px);
    box-shadow: 0 4px 15px rgba(0, 90, 156, 0.04);
  }
  .card-green-track {
    border-top-color: #008C45;
    background: linear-gradient(180deg, rgba(0, 140, 69, 0.03) 0%, rgba(255, 255, 255, 1) 120px);
    box-shadow: 0 4px 15px rgba(0, 140, 69, 0.04);
  }
  .card-black-track {
    border-top-color: #1A1A1A;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.02) 0%, rgba(255, 255, 255, 1) 120px);
    box-shadow: 0 4px 15px rgba(26, 26, 26, 0.03);
  }

  .funnel-card:hover {
    transform: translateY(-4px);
  }
  .card-blue-track:hover  { box-shadow: 0 10px 20px rgba(0, 90, 156, 0.1); }
  .card-green-track:hover { box-shadow: 0 10px 20px rgba(0, 140, 69, 0.1); }
  .card-black-track:hover { box-shadow: 0 10px 20px rgba(26, 26, 26, 0.08); }

  /* ── Pillar logo placeholder slot ─────────────────────────────────
     Reserved spot at the top of each pillar card for a future per-
     pillar logo.  The slot is sized to gracefully accept either a
     circle badge OR a banner-style mark like the Tenki master logo:
       • Square / circle:  72 × 72 px (centered, max 64 × 64 inner)
       • Wide banner:      up to ~140 × 56 px (logo's natural ratio)
     Today the slot displays the existing pillar emoji styled as a
     soft tinted circle.  When real logos arrive, replace the inner
     placeholder span with <img class="pillar-logo-img" ...> and the
     slot styles do the rest. */
  .pillar-logo-slot {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px auto;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Subtle inner border + ring so the slot reads as "intentional
       brand mark" not "empty container".  Track color comes from the
       card's parent .card-*-track override below. */
    background: rgba(0, 0, 0, 0.02);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04),
                0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .funnel-card:hover .pillar-logo-slot { transform: scale(1.04); }
  /* Per-track tints for the placeholder background */
  .card-blue-track  .pillar-logo-slot { background: rgba(0, 90, 156, 0.07); }
  .card-green-track .pillar-logo-slot { background: rgba(0, 140, 69, 0.07); }
  .card-black-track .pillar-logo-slot { background: rgba(26, 26, 26, 0.05); }

  /* Inner placeholder — the emoji that lives in the slot until a real
     logo arrives.  Sized + colored so it doesn't look like a hack. */
  .pillar-logo-placeholder {
    font-size: 1.9rem;
    line-height: 1;
    filter: saturate(0.95);
    pointer-events: none;
    user-select: none;
  }
  /* Future <img> replacement — use this class once the asset lands.
     `object-fit: contain` works for both circle badges and banner
     marks because the slot's 72 × 72 frame has equal inner padding. */
  .pillar-logo-slot .pillar-logo-img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
    display: block;
  }
  /* If the future asset is explicitly a wide banner (like Tenki's
     master mark), opt it into a wider crop with the .pillar-logo-img
     --wide modifier. */
  .pillar-logo-slot .pillar-logo-img.wide {
    max-width: 94%;
    max-height: 56%;
  }

  .card-top-accent { margin-bottom: 12px; }

  .pill-amount {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
  }

  .card-blue-track .pill-amount  { background-color: #EEF5FB; color: #005A9C; }
  .card-green-track .pill-amount { background-color: #E8F5E9; color: #008C45; }
  .card-black-track .pill-amount { background-color: #F4F4F4; color: #1A1A1A; }

  .funnel-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    color: #1A1A1A;
    font-weight: 700;
    line-height: 1.3;
  }

  .impact-desc {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #555555;
    margin: 0 0 15px 0;
  }

  .card-footer-action {
    margin-top: auto;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
  }

  .card-blue-track .card-footer-action  { color: #005A9C; }
  .card-green-track .card-footer-action { color: #008C45; }
  .card-black-track .card-footer-action { color: #1A1A1A; }

  .card-footer-action::after { content: '→'; font-size: 0.9rem; }
  .funnel-card:hover .card-footer-action { gap: 8px; }

  /* Master CTA Layout block */
  .funnel-cta-banner {
    background-color: #1A1A1A;
    border-radius: 10px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  }

  .banner-text { flex: 1; }

  .banner-text h4 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #008C45;
    font-weight: 800;
  }

  .banner-text p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #E2E8F0;
  }

  /* Payment methods affordance — text only, no logos so it stays small
     and doesn't trigger trademark issues.  Lives under the trust copy. */
  .banner-methods {
    margin-top: 6px !important;
    font-size: 0.82rem !important;
    color: #A0AEC0 !important;
    letter-spacing: 0.3px;
  }

  .master-donate-btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: #008C45;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: 2px solid #008C45;
  }

  .master-donate-btn:hover {
    transform: translateY(-2px);
    background-color: transparent;
    color: #008C45;
    box-shadow: 0 4px 12px rgba(0, 140, 69, 0.25);
  }

  /* Mobile responsive adaptations */
  @media (max-width: 900px) {
    .funnel-cta-banner {
      flex-direction: column;
      text-align: center;
      padding: 20px;
    }
    .master-donate-btn { width: 100%; text-align: center; }
  }

  @media (max-width: 768px) {
    .tenki-funnel-container { padding: 20px 15px; margin: 25px auto; }
    .funnel-header h2 { font-size: 1.5rem; }
    .funnel-intro    { font-size: 0.92rem; }
    .funnel-grid     { grid-template-columns: 1fr; gap: 15px; }
    .banner-methods  { font-size: 0.76rem !important; }
    /* Card CTAs get a 44px touch target on phones */
    .funnel-card { padding: 22px 18px; min-height: 44px; }
    .master-donate-btn { padding: 14px 28px; }
  }