:root {
    --tenki-blue: #005A9C;
    --tenki-blue-light: #eef5fb;
    --tenki-green: #008C45;
    --tenki-green-light: #e8f5e9;
    --tenki-black: #1A1A1A;
    --tenki-white: #FFFFFF;
    /* Tenki SOS (white pillar) — uses charcoal as the actual stroke color
       since pure white would be invisible on the white timeline background */
    --tenki-white-stroke: #2A2A2A;
    --tenki-white-light:  #FAF6EE;
    --tenki-white-border: #C0C5CC;
    --bg-light: #F8F9FA;
    --text-dark: #222222;
    --text-light: #555555;
    --timeline-line: #E2E8F0;

    --phase-accomplished-bg: #e8f5e9;
    --phase-accomplished-text: #2e7d32;
    --phase-planning-bg: #e3f2fd;
    --phase-planning-text: #1565c0;
    --phase-execution-bg: #fff8e1;
    --phase-execution-text: #f57f17;
    --phase-future-bg: #f5f5f5;
    --phase-future-text: #616161;
  }

  body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tenki-white);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
  }

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

  .dashboard-container {
    max-width: 1200px;
    margin: 30px auto;
    background-color: var(--bg-light);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
  }

  .dashboard-header {
    text-align: center;
    margin-bottom: 25px;
    order: 1;
    position: relative;
    z-index: 10;
  }

  .dashboard-header h2 {
    color: var(--tenki-black);
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    font-weight: 800;
  }

  .dashboard-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.5;
  }

  .system-state-container {
    text-align: center;
    padding: 60px 20px;
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 90, 156, 0.1);
    border-left-color: var(--tenki-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
  }

  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

  .state-message { font-weight: 600; color: var(--text-light); font-size: 1.1rem; }
  .error-state { color: #d32f2f; }
  .error-icon { font-size: 2rem; margin-bottom: 10px; }
  .diagnostic-info { display: block; font-size: 0.85rem; color: #555; margin-top: 10px; font-weight: normal; background: #f5f5f5; padding: 10px; border-radius: 6px;}

  /* Control Bar */
  .dashboard-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    order: 3;
    position: relative;
    width: 100%;
    z-index: 150;
  }

  .filters-scroll-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
  }

  .timeline-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
  }

  .dropdown-wrapper { position: relative; display: inline-block; }

  .filter-btn {
    background-color: var(--tenki-white); border: 2px solid var(--timeline-line);
    color: var(--text-light); padding: 8px 20px; border-radius: 30px;
    font-family: inherit; font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
    transition: all 0.2s ease;
    height: 38px;
    line-height: 1.2;
    box-sizing: border-box;
  }
  .filter-btn:hover { border-color: #CCCCCC; color: var(--text-dark); }

  .dropdown-toggle-btn {
    padding-right: 32px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555555'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
  }

  .dropdown-menu-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--tenki-white) !important;
    border: 1px solid var(--timeline-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    min-width: 240px;
    padding: 6px 0;
    max-height: 260px;
    overflow-y: auto;
    z-index: 2010;
  }

  .dropdown-menu-options.open { display: block; }

  .dropdown-opt-item {
    padding: 10px 20px; font-size: 0.85rem; font-weight: 600; color: var(--text-dark);
    cursor: pointer; text-transform: none; transition: background-color 0.15s ease, color 0.15s ease;
  }
  .dropdown-opt-item:hover { background-color: var(--bg-light); color: var(--tenki-blue); }

  .filter-btn.active[data-filter="all"] { background-color: var(--tenki-black); border-color: var(--tenki-black); color: var(--tenki-white); }

  .dropdown-wrapper[data-filter="Clinic Track"] .dropdown-toggle-btn.active {
    background-color: var(--tenki-blue); border-color: var(--tenki-blue); color: var(--tenki-white);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  }
  .dropdown-wrapper[data-filter="Literacy Track"] .dropdown-toggle-btn.active {
    background-color: var(--tenki-green); border-color: var(--tenki-green); color: var(--tenki-white);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  }
  .dropdown-wrapper[data-filter="The Engine"] .dropdown-toggle-btn.active,
  .dropdown-wrapper[data-filter="Tenki Organization"] .dropdown-toggle-btn.active {
    background-color: var(--tenki-black); border-color: var(--tenki-black); color: var(--tenki-white);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  }

  /* Structural Hide Classes */
  .filtered-out { display: none !important; }
  .collapsed-by-year { display: none !important; }
  .year-badge.dimmed { opacity: 0.5; background-color: var(--text-light) !important; color: #FFF; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2) !important; }
  /* Third click on year badge: fully hide even the collapsed chips */
  .year-badge.super-dimmed { opacity: 0.25 !important; background-color: #777 !important; color: #FFF; box-shadow: inset 0 2px 4px rgba(0,0,0,0.25) !important; }
  .timeline-block.super-hidden-by-year { display: none !important; }

  /* Map & Sidebar Desktop Environments */
  .map-interface-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    height: 500px;
    order: 5;
    position: relative;
    z-index: 10;
  }

  #leaflet-map-canvas {
    border-radius: 12px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05); height: 100%; z-index: 1;
    background-color: #f1f3f4;
  }

  /* Desktop Map Sidebar Detail View */
  .map-details-sidebar {
    background-color: var(--tenki-white); border-radius: 12px; padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); display: flex; flex-direction: column;
    border: 1px solid rgba(0,0,0,0.05); overflow-y: auto;
  }

  .details-placeholder { margin: auto; text-align: center; color: var(--text-light); }
  .details-placeholder svg { width: 50px; height: 50px; fill: #CCCCCC; margin-bottom: 12px; }

  .details-content-view { display: none; flex-direction: column; height: 100%; }
  .details-content-view.active { display: flex; }

  .details-content-view h3 { margin: 0 0 4px 0; font-size: 1.4rem; color: var(--text-dark); }
  .details-region { font-size: 0.85rem; font-weight: 600; color: var(--text-light); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.3px; }
  .details-content-view p { margin: 0 0 20px 0; font-size: 0.95rem; line-height: 1.5; color: var(--text-light); }

  /* Desktop Floating Nav */
  .floating-nav-container {
    display: flex;
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    flex-direction: column;
    animation: expandFadeIn 0.3s ease;
  }

  .floating-controls-group { display: flex; align-items: center; gap: 8px; }
  .nav-arrow { display: none; } /* Hidden arrows on desktop */

  .all-tracks-reset-btn {
    background: var(--tenki-black); color: var(--tenki-white); border: none;
    padding: 10px 20px; border-radius: 30px; font-weight: 700; font-size: 0.85rem;
    text-transform: uppercase; box-shadow: 0 4px 15px rgba(0,0,0,0.18);
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .all-tracks-reset-btn:hover { background: #333; transform: translateY(-2px); }
  .all-tracks-reset-btn img { height: 18px; width: auto; object-fit: contain; border-radius: 2px; }
  .all-tracks-reset-btn svg { transition: transform 0.3s ease; }
  .floating-nav-container.menu-open .all-tracks-reset-btn svg { transform: rotate(180deg); }

  .floating-nav-menu {
    position: absolute; bottom: calc(100% + 10px); left: 0; background: var(--tenki-white);
    border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); padding: 8px 0;
    display: flex; flex-direction: column; min-width: 240px; max-height: 55vh; overflow-y: auto;
    scrollbar-width: thin; opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: all 0.2s ease; border: 1px solid rgba(0,0,0,0.05);
  }
  .floating-nav-menu::-webkit-scrollbar { width: 6px; }
  .floating-nav-menu::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 4px; }
  .floating-nav-container.menu-open .floating-nav-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }

  .floating-nav-item {
    padding: 12px 20px; font-size: 0.85rem; font-weight: 700; color: var(--text-dark);
    cursor: pointer; transition: background 0.2s; display: flex; align-items: center; gap: 10px;
  }
  .floating-nav-item:hover { background: var(--bg-light); color: var(--tenki-blue); }
  .floating-nav-item.sub-track { padding-left: 42px; font-size: 0.78rem; font-weight: 600; color: var(--text-light); padding-top: 8px; padding-bottom: 8px; }

  /* Map Markers */
  .custom-map-pin {
    width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--tenki-white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3); transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .pin-blue { background-color: var(--tenki-blue); }
  .pin-green { background-color: var(--tenki-green); }
  .pin-white { background-color: var(--tenki-white-stroke); border-color: var(--tenki-white-border); }
  .pin-black { background-color: var(--tenki-black); }
  .custom-map-pin.active-pin { transform: scale(1.4); z-index: 1000 !important; border-width: 4px; }

  .tag-container { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 auto;}
  .details-tag {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 3px 8px; border-radius: 4px; display: inline-block; align-self: flex-start;
  }
  .tag-blue { background-color: var(--tenki-blue-light); color: var(--tenki-blue); }
  .tag-green { background-color: var(--tenki-green-light); color: var(--tenki-green); }
  .tag-white { background-color: var(--tenki-white-light); color: var(--tenki-white-stroke); border: 1px solid var(--tenki-white-border); }
  .tag-black { background-color: #F4F4F4; color: var(--tenki-black); }

  .locations-list-container { margin: 15px 0; padding: 12px; background: rgba(0,0,0,0.02); border-radius: 8px; border-left: 3px solid var(--timeline-line); }
  .locations-list-container h4 { margin: 0 0 8px 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); }
  .locations-list { margin: 0; padding-left: 20px; font-size: 0.85rem; color: var(--text-dark); max-height: 180px; overflow-y: auto; }
  .locations-list li { margin-bottom: 4px; }
  .locations-list li.interactive-loc { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: all 0.2s ease; }
  .locations-list li.interactive-loc:hover { color: var(--tenki-blue); text-decoration-color: var(--tenki-blue); }

  .details-cta-group { margin-top: auto; padding-top: 15px; display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .details-cta-link {
    display: block; width: 100%; padding: 12px;
    background-color: var(--tenki-black); color: var(--tenki-white); text-align: center; text-decoration: none;
    font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 6px;
    transition: all 0.2s ease;
  }
  .details-cta-link.link-blue { background-color: var(--tenki-blue); }
  .details-cta-link.link-green { background-color: var(--tenki-green); }
  .details-cta-link.link-white { background-color: var(--tenki-white-stroke); color: var(--tenki-white); }
  .details-cta-link.secondary-btn { background-color: transparent; color: var(--text-dark); border: 2px solid var(--timeline-line); }
  .details-cta-link.secondary-btn:hover { border-color: var(--tenki-black); color: var(--tenki-black); }

  /* Desktop Timeline Horizontal Rail Section */
  .timeline-outer-wrapper { position: relative; width: 100%; order: 4; overflow: hidden; z-index: 10; }

  .scroll-btn {
    display: none; align-items: center; justify-content: center; position: absolute;
    top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
    background-color: var(--tenki-white); border: 2px solid var(--timeline-line); border-radius: 50%;
    cursor: pointer; z-index: 20; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: all 0.2s ease;
  }
  .scroll-btn svg { width: 24px; height: 24px; fill: var(--text-light); transition: fill 0.2s ease; }
  .scroll-btn:hover { background-color: var(--tenki-black); border-color: var(--tenki-black); }
  .scroll-btn:hover svg { fill: var(--tenki-white); }
  .prev-btn { left: -22px; }
  .next-btn { right: -22px; }
  @media (min-width: 769px) { .scroll-btn { display: flex; } }

  .timeline-scroll-wrapper {
    overflow-x: auto; padding: 25px 10px; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; margin-bottom: 40px;
    touch-action: pan-y pinch-zoom; scroll-padding-left: 20px; cursor: grab;
  }
  .timeline-scroll-wrapper::-webkit-scrollbar { display: none; }
  .timeline-scroll-wrapper.is-dragging { cursor: grabbing; user-select: none; }

  .timeline-track { display: flex; gap: 25px; position: relative; padding-top: 65px; min-width: max-content; }
  .timeline-track::before { content: ''; position: absolute; height: 4px; background-color: var(--timeline-line); top: 40px; left: 0; right: 0; z-index: 1; }

  .year-divider { position: relative; flex: 0 0 60px; display: flex; justify-content: center; scroll-snap-align: start; }
  .year-badge {
    position: absolute; top: -37px; background-color: var(--tenki-black); color: var(--tenki-white);
    font-weight: 800; font-size: 1.05rem; padding: 6px 16px; border-radius: 20px; z-index: 5;
    letter-spacing: 1px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); cursor: pointer; transition: all 0.2s;
  }
  .year-badge:hover { opacity: 0.8; }

  .timeline-block {
    position: relative; flex: 0 0 290px; transition: opacity 0.3s ease; scroll-snap-align: start; cursor: pointer;
  }
  .timeline-block:focus-visible { outline: 3px solid var(--tenki-blue); outline-offset: 4px; border-radius: 10px; }
  .timeline-block * { pointer-events: none; }
  .timeline-block .details-cta-group *, .timeline-block .locations-list-container *, .timeline-block .funding-badge, .timeline-block .share-btn, .timeline-block .click-indicator { pointer-events: auto; }

  .timeline-node {
    width: 18px; height: 18px; position: absolute; border-radius: 50%;
    background-color: var(--tenki-white); border: 4px solid var(--tenki-black);
    top: -32px; left: 20px; z-index: 2; transition: transform 0.2s ease, background-color 0.2s ease;
    pointer-events: auto !important;
  }

  .timeline-block.focused .timeline-node, .timeline-block.active .timeline-node { transform: scale(1.25); background-color: var(--tenki-black); }
  .timeline-block.focused .node-blue, .timeline-block.active .node-blue { background-color: var(--tenki-blue); border-color: var(--tenki-blue); }
  .timeline-block.focused .node-green, .timeline-block.active .node-green { background-color: var(--tenki-green); border-color: var(--tenki-green); }
  .timeline-block.focused .node-white, .timeline-block.active .node-white { background-color: var(--tenki-white-stroke); border-color: var(--tenki-white-stroke); }

  .timeline-card {
    background-color: var(--tenki-white); border-radius: 10px; padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); border-top: 5px solid var(--tenki-black);
    display: flex; flex-direction: column; height: 100%; transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .card-blue-track { border-top-color: var(--tenki-blue); }
  .card-green-track { border-top-color: var(--tenki-green); }
  .card-white-track { border-top-color: var(--tenki-white-stroke); border-top-style: dashed; }
  .card-black-track { border-top-color: var(--tenki-black); }

  .timeline-block.active .timeline-card { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

  .card-badge-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; width: 100%; }

  .phase-badge, .funding-badge {
    display: inline-block; font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
    padding: 4px 8px; border-radius: 4px; letter-spacing: 0.5px;
    align-self: flex-start; text-decoration: none;
  }
  button.funding-badge { transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; }
  button.funding-badge:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

  .share-btn {
    background: none; border: none; color: #555 !important; cursor: pointer;
    display: inline-flex !important; align-items: center; gap: 4px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    transition: color 0.2s, background 0.2s;
    padding: 4px 8px; border-radius: 4px;
    pointer-events: auto; visibility: visible !important; opacity: 1 !important;
  }
  .share-btn:hover { color: var(--tenki-blue) !important; background: var(--bg-light); }
  .share-btn:hover svg { fill: var(--tenki-blue) !important; }
  /* Belt-and-suspenders: force the inline SVG inside the share button to
     render at a guaranteed visible size + color even if a Squarespace global
     CSS rule tries to zero them out. */
  .share-btn svg { width: 16px !important; height: 16px !important;
                   display: inline-block !important; flex-shrink: 0;
                   color: #555 !important; }
  .share-btn svg path { fill: currentColor; }

  .phase-accomplished { background-color: var(--phase-accomplished-bg); color: var(--phase-accomplished-text); }
  .phase-planning { background-color: var(--phase-planning-bg); color: var(--phase-planning-text); }
  .phase-execution { background-color: var(--phase-execution-bg); color: var(--phase-execution-text); }
  .phase-future { background-color: var(--phase-future-bg); color: var(--phase-future-text); }

  .funding-seeking { background-color: #fff0f0; color: #d32f2f; border: 1px solid rgba(211, 47, 47, 0.2); }
  .funding-partial { background-color: #fff9e6; color: #e65100; border: 1px solid rgba(230, 81, 0, 0.2); }
  .funding-full { background-color: #e8f5e9; color: #2e7d32; border: 1px solid rgba(46, 125, 50, 0.2); }
  .funding-active { background-color: #e3f2fd; color: #0d47a1; font-weight: 900; border: 1px dashed #0d47a1; }

  .time-marker { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block;}

  /* ── Duration Span ─────────────────────────────── */
  .duration-span {
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .duration-dates {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-light); display: flex; align-items: center; gap: 4px;
  }
  .duration-dates .dur-arrow { color: #bbb; }
  .duration-pill {
    font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
    padding: 2px 7px; border-radius: 10px; background: rgba(0,0,0,0.06); color: var(--text-light);
    white-space: nowrap;
  }
  .card-blue-track .duration-pill { background: var(--tenki-blue-light); color: var(--tenki-blue); }
  .card-green-track .duration-pill { background: var(--tenki-green-light); color: var(--tenki-green); }
  .card-white-track .duration-pill { background: var(--tenki-white-light); color: var(--tenki-white-stroke); border: 1px solid var(--tenki-white-border); }
  /* Chip duration suffix */
  .chip-duration { font-size: 0.72em; font-weight: 600; opacity: 0.7; margin-left: 4px; }

  /* ── Duration Line Extension (desktop: rightward, ABOVE the spine) ──────── */
  /* Track padding-top:65px, spine top:40px → block-relative spine = -25px.   */
  /* Lane 0 at -47px clears year-badge top (≈ -37px) by 5px — no overlap.    */
  /* Bar left/top/width are ALL overridden by updateDurationLines() per event. */
  /* Bar starts at event startDate track-position, ends at endDate position.   */
  .duration-line-ext {
    position: absolute;
    top: -47px;   /* lane-0 default; JS overrides per lane                      */
    left: 0;      /* JS sets to startDate track-pos relative to block left       */
    height: 7px;
    width: 0;     /* set dynamically                                             */
    border-radius: 4px;
    opacity: 0.75;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
  }
  /* Vertical stem: drops from bar bottom to the spine. left/top/height set by JS. */
  .duration-stem {
    position: absolute;
    width: 4px;
    border-radius: 0 0 3px 3px;
    opacity: 0.9;
    pointer-events: none;
    z-index: 3;
  }
  /* Colored circle at spine level, anchoring bar to event node. left/top set by JS. */
  .duration-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.9;
    pointer-events: none;
    z-index: 3;
  }
  .timeline-block[data-track="blue"]  .duration-line-ext,
  .timeline-block[data-track="blue"]  .duration-stem,
  .timeline-block[data-track="blue"]  .duration-dot  { background: var(--tenki-blue); }
  .timeline-block[data-track="green"] .duration-line-ext,
  .timeline-block[data-track="green"] .duration-stem,
  .timeline-block[data-track="green"] .duration-dot  { background: var(--tenki-green); }
  .timeline-block[data-track="black"] .duration-line-ext,
  .timeline-block[data-track="black"] .duration-stem,
  .timeline-block[data-track="black"] .duration-dot  { background: var(--tenki-black); }
  .timeline-block[data-track="white"] .duration-line-ext,
  .timeline-block[data-track="white"] .duration-stem,
  .timeline-block[data-track="white"] .duration-dot  { background: var(--tenki-white-stroke); }
  .timeline-block.active  .duration-line-ext,
  .timeline-block.focused .duration-line-ext { opacity: 0.78; }
  .timeline-block.collapsed-by-year    .duration-stem,
  .timeline-block.collapsed-by-year    .duration-dot  { opacity: 0 !important; }
  .timeline-block.super-hidden-by-year .duration-stem,
  .timeline-block.super-hidden-by-year .duration-dot  { display: none !important; }

  /* ── Tab Intro Bounce ──────────────────────────── */
  @keyframes tabIntroBounce {
    0%   { transform: scale(1); }
    20%  { transform: scale(1.18); color: var(--tenki-blue); }
    40%  { transform: scale(0.93); }
    60%  { transform: scale(1.08); }
    80%  { transform: scale(0.97); }
    100% { transform: scale(1); }
  }
  .mobile-tab.intro-bounce { animation: tabIntroBounce 0.7s ease forwards; }
  /* Hidden on desktop; shown via mobile media query */
  .mobile-tab-hint { display: none; }

  /* PROTECTED DESKTOP HEADERS */
  .timeline-card h3 { margin: 0 0 6px 0 !important; font-size: 1.1rem !important; color: var(--text-dark) !important; font-weight: 700 !important; line-height: 1.2 !important; }
  .timeline-card p { margin: 0 !important; font-size: 0.88rem !important; line-height: 1.4 !important; color: var(--text-light) !important; }
  .click-indicator { margin-top: auto; padding-top: 15px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #999999; }
  button.click-indicator { background: none; border: none; display: block; width: 100%; text-align: left; cursor: pointer; }
  button.click-indicator:hover { color: var(--tenki-blue); }

  /* Desktop Protection for Hidden Elements */
  .collapsed-label { display: none !important; }
  .mobile-inline-details { display: none !important; }
  .return-to-map-btn { display: none !important; }
  .mobile-tab-bar { display: none; }

  /* Mobile View Framework Implementations */
  @media (max-width: 950px) {
    .map-interface-grid { grid-template-columns: 1fr; height: auto; gap: 20px; }
    #leaflet-map-canvas { height: 350px; }
    .map-details-sidebar { min-height: 220px; }
  }

  @media (max-width: 768px) {
    /* 100dvh Layout locks strictly to the screen limits */
    .dashboard-container {
      padding: 0; margin: 0; border-radius: 0; height: 100dvh !important; max-height: 100dvh !important;
      display: flex; flex-direction: column; overflow: hidden; position: relative; border: none; background-color: var(--bg-light);
    }

    /* Compact Headings */
    .dashboard-header {
      background: #FFFFFF; margin: 0; padding: 10px 15px 5px 15px;
      z-index: 10 !important; position: relative; flex-shrink: 0; border-radius: 10px 10px 0 0;
    }
    .dashboard-header p { display: none !important; }
    .dashboard-header h2 { font-size: 1.2rem; margin: 0; }

    /* Control Bar boosted Z-index for upward dropdown overlays */
    .dashboard-controls {
      padding: 5px 0px 10px 0px; margin-bottom: 0; gap: 10px; z-index: 99999 !important;
      position: relative; background: #FFFFFF; border-bottom: none; flex-shrink: 0;
    }

    .filters-scroll-wrapper { width: 100%; overflow: visible !important; z-index: 99999 !important;}

    .filters-scroll-wrapper::before, .filters-scroll-wrapper::after {
      content: ''; position: absolute; top: 0; width: 45px; height: 38px; z-index: 160; pointer-events: none; transition: opacity 0.2s ease; opacity: 0;
    }
    .filters-scroll-wrapper::before { left: 0; background: linear-gradient(to right, #FFFFFF 40%, rgba(255,255,255,0) 100%); }
    .filters-scroll-wrapper::after { right: 0; background: linear-gradient(to left, #FFFFFF 40%, rgba(255,255,255,0) 100%); }
    .filters-scroll-wrapper.left-hint-active::before { opacity: 1; }
    .filters-scroll-wrapper.right-hint-active::after { opacity: 1; }

    .timeline-filters {
      flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto !important;
      padding: 0 45px 0 15px !important; gap: 8px; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; overflow-y: visible !important;
      z-index: 99999 !important;
    }
    .timeline-filters::-webkit-scrollbar { display: none !important; }

    .dropdown-wrapper { flex: 0 0 auto; display: inline-block; overflow: visible !important; }
    .filter-btn { white-space: nowrap; padding: 6px 14px; font-size: 0.78rem; }

    .dropdown-menu-options { z-index: 999999 !important; }

    /* MAP FLEX WRAPPER - Hidden by default, shown via Map tab */
    .map-interface-grid {
      position: relative !important; display: none !important; flex-direction: column !important;
      flex: 1 1 auto !important; height: auto !important; width: 100% !important;
      z-index: 10; padding: 0; margin: 0; transition: flex 0.3s ease;
    }

    #leaflet-map-canvas {
      flex: 1; width: 100%; height: 100% !important; border-radius: 0; border: none; z-index: 1;
    }

    .map-details-sidebar { display: none !important; }

    /* Native Map Controls Moved Down Slightly to clear track buttons */
    .leaflet-top.leaflet-left { top: 75px !important; left: 10px !important; transform: none !important; }

    /* FLOATING NAV COMMAND CENTER (Card bar fixed to bottom) */
    .floating-nav-container {
      display: flex !important; position: absolute !important; bottom: 14px !important; left: 50% !important; right: auto !important;
      transform: translateX(-50%) !important; z-index: 9000 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important;
      animation: none !important; width: 88% !important; max-width: 310px !important;
    }

    .floating-controls-group {
      background: rgba(255,255,255,0.97); border-radius: 16px; padding: 4px 6px;
      box-shadow: 0 2px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.07);
      display: flex; align-items: center; justify-content: space-between !important; width: 100% !important; border: none;
      backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    }

    .nav-arrow {
      display: flex !important; background: transparent !important; border: none; color: var(--tenki-blue) !important;
      width: 40px !important; height: 40px !important; border-radius: 10px !important; align-items: center; justify-content: center;
      font-weight: bold; transition: background 0.15s; cursor: pointer; padding: 0; font-size: 1.15rem !important; pointer-events: auto; flex-shrink: 0;
    }
    .nav-arrow:active { background: rgba(0,90,156,0.1) !important; }
    .nav-arrow:disabled { color: #c0cdd8 !important; opacity: 1 !important; pointer-events: none; }

    .all-tracks-reset-btn {
      box-shadow: none !important; margin: 0 auto !important; background: transparent !important;
      color: var(--tenki-black) !important; padding: 6px 10px !important; flex: 1; justify-content: center;
      font-size: 0.72rem !important; letter-spacing: 0.6px !important;
    }
    .all-tracks-reset-btn img { display: none !important; } /* Tenki logo not needed in nav bar */
    .all-tracks-reset-btn:hover { background: transparent !important; transform: none; }
    .all-tracks-reset-btn svg { display: none !important; } /* Hide mobile dropdown caret */

    .floating-nav-menu { display: none !important; } /* Disabled drop-down menu on mobile */

    /* TIMELINE FLOW CONTAINER: Standard Document Flex Rules below Map */
    .timeline-outer-wrapper {
      position: relative !important; flex: 1 1 auto !important; width: 100% !important;
      display: flex !important; flex-direction: column !important; background: #F8F9FA !important;
      box-shadow: inset 0 4px 10px rgba(0,0,0,0.02) !important; border: none !important; margin: 0 !important;
      transform: none !important; overflow: hidden !important;
    }

    .timeline-scroll-wrapper {
      flex: 1 1 auto !important; width: 100%; overflow-x: hidden !important; overflow-y: auto !important;
      height: auto !important; max-height: none !important; padding: 15px 15px 95px 15px !important;
      -webkit-overflow-scrolling: touch;
    }

    .timeline-track {
      display: flex !important; flex-direction: column !important; gap: 15px !important;
      padding-top: 5px !important; min-width: auto !important; padding-left: 28px !important;
    }

    .timeline-track::before {
      width: 4px !important; height: 100% !important; top: 0 !important; bottom: 0 !important; left: 10px !important;
      background-color: rgba(26, 26, 26, 0.3) !important; box-shadow: 0 0 0 3px rgba(255,255,255,0.2) !important; z-index: 1;
    }

    .timeline-block {
      position: relative !important; flex: 0 0 auto !important; width: 100% !important; max-width: none !important;
      display: flex !important; align-items: center !important; scroll-snap-align: none !important; min-height: 40px !important; margin-bottom: 12px !important; cursor: pointer;
    }

    /* Hide card when not active */
    .timeline-block:not(.active) .timeline-card { display: none !important; }

    /* Show card when active */
    .timeline-block.active .timeline-card { display: flex !important; margin-top: 5px; }

    .timeline-block:not(.active) { display: flex !important; align-items: center !important; cursor: pointer; }

    .timeline-block .timeline-node { top: 50% !important; transform: translateY(-50%) !important; left: -32px !important; position: absolute !important;}
    .timeline-block.active .timeline-node, .timeline-block.focused .timeline-node { transform: translateY(-50%) scale(1.3) !important; }

    .year-divider {
      position: relative; flex: 0 0 auto !important; display: flex !important; justify-content: flex-start !important;
      margin-left: -28px !important; margin-top: 15px !important; margin-bottom: 5px !important;
    }

    .year-badge { position: relative !important; top: 0 !important; font-size: 0.95rem !important; }

    .timeline-card { background: var(--tenki-white) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; padding: 15px !important; }
    .card-badge-row { display: flex !important; }

    /* Bubble Formatting Protected & Colored by Track */
    .timeline-block:not(.active) .collapsed-label {
       display: block !important; font-size: 0.85rem !important; font-weight: 700 !important; padding: 10px 16px !important;
       border-radius: 20px !important; white-space: normal !important; overflow: hidden !important; text-overflow: ellipsis !important;
       max-width: 90% !important; border: 1px solid rgba(0,0,0,0.1) !important; transition: all 0.2s ease !important; line-height: 1.4 !important;
    }

    .timeline-block.active .collapsed-label, .timeline-block.focused .collapsed-label { color: #fff !important; box-shadow: 0 6px 15px rgba(0,0,0,0.15) !important; border-color: transparent !important;}
    .timeline-block.active[data-track="blue"] .collapsed-label, .timeline-block.focused[data-track="blue"] .collapsed-label { background: var(--tenki-blue) !important; }
    .timeline-block.active[data-track="green"] .collapsed-label, .timeline-block.focused[data-track="green"] .collapsed-label { background: var(--tenki-green) !important; }
    .timeline-block.active[data-track="black"] .collapsed-label, .timeline-block.focused[data-track="black"] .collapsed-label { background: var(--tenki-black) !important; }
    .timeline-block.active[data-track="white"] .collapsed-label, .timeline-block.focused[data-track="white"] .collapsed-label { background: var(--tenki-white-stroke) !important; }

    /* Non-active bubbles carry a soft tint of their track color */
    .timeline-block:not(.active):not(.focused)[data-track="blue"] .collapsed-label { background: var(--tenki-blue-light) !important; color: var(--tenki-blue) !important; border-color: rgba(0,90,156,0.2) !important; }
    .timeline-block:not(.active):not(.focused)[data-track="green"] .collapsed-label { background: var(--tenki-green-light) !important; color: var(--tenki-green) !important; border-color: rgba(0,140,69,0.2) !important; }
    .timeline-block:not(.active):not(.focused)[data-track="black"] .collapsed-label { background: #f0f0f0 !important; color: var(--tenki-black) !important; border-color: rgba(0,0,0,0.12) !important; }
    .timeline-block:not(.active):not(.focused)[data-track="white"] .collapsed-label { background: var(--tenki-white-light) !important; color: var(--tenki-white-stroke) !important; border-color: var(--tenki-white-border) !important; }

    /* STRICT LOCAL YEAR COLLAPSE CSS overrides */
    html body .timeline-block.collapsed-by-year .collapsed-label,
    html body .timeline-block.collapsed-by-year[data-track] .collapsed-label,
    html body .timeline-block.collapsed-by-year:not(.active)[data-track] .collapsed-label {
        display: none !important;
    }
    .timeline-block.collapsed-by-year { min-height: 20px !important; margin-bottom: 5px !important; }

    /* ── Duration Line (mobile: downward from node bottom) ── */
    /* Sibling of .timeline-node; node sits at top:50%/left:-32px/18×18.      */
    /* Node visual bottom = 50%+9px; left/height overridden by JS per lane.   */
    .duration-line-ext {
      top: calc(50% + 9px);  /* node visual bottom — JS also sets top:auto    */
      left: -25px;            /* lane-0 default; JS overrides per lane         */
      width: 5px;
      height: 0;              /* set dynamically by updateDurationLines()      */
      border-radius: 0 0 3px 3px;
      opacity: 0.28;
    }
    /* Stem and dot are desktop-only — hide on mobile */
    .duration-stem,
    .duration-dot { display: none; }
    .timeline-block.active  .duration-line-ext,
    .timeline-block.focused .duration-line-ext { opacity: 0.75; }
    .timeline-block.collapsed-by-year   .duration-line-ext { opacity: 0 !important; }
    .timeline-block.super-hidden-by-year .duration-line-ext { display: none !important; }

    /* Expanded Details Mobile Logic */
    .timeline-block.active .mobile-inline-details {
      display: block !important; margin-top: 12px !important; padding-top: 12px !important; border-top: 1px solid rgba(226, 232, 240, 0.6) !important;
    }
    .mobile-inline-details p { margin-bottom: 10px !important; font-size: 0.9rem !important; color: var(--text-light) !important; line-height: 1.4 !important; white-space: normal !important; }
    .mobile-inline-details .details-region { font-size: 0.8rem !important; font-weight: 700 !important; color: var(--text-light) !important; margin-bottom: 8px !important; text-transform: uppercase !important; letter-spacing: 0.5px !important; }
    .mobile-inline-details .locations-list { max-height: 140px !important; }
    .mobile-inline-details .details-cta-group { margin-top: 5px !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 8px !important; }
    .mobile-inline-details .details-cta-link { padding: 8px 12px !important; font-size: 0.75rem !important; width: auto !important; flex: 1; min-width: 120px; }

    .return-to-map-btn { display: none !important; } /* Stripped completely from Mobile UI */

    /* ── Mobile Tab Bar ──────────────────────────────── */
    .mobile-tab-bar {
      display: flex; flex-shrink: 0; position: relative; z-index: 20;
      background: #fff; border-bottom: 1px solid var(--timeline-line);
      order: 4; /* Sits between controls (order 3) and timeline content */
    }
    .mobile-tab {
      flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
      padding: 10px 8px; border: none; background: none; cursor: pointer;
      font-size: 0.85rem; font-weight: 600; color: var(--text-light);
      border-bottom: 3px solid transparent;
      transition: color 0.2s ease, border-color 0.2s ease;
    }
    .mobile-tab.active { color: var(--tenki-blue); border-bottom-color: var(--tenki-blue); }
    .mobile-tab svg { flex-shrink: 0; }

    /* Map tab active: show map, hide timeline */
    .dashboard-container.mobile-map-view .map-interface-grid {
      display: flex !important; flex: 1 1 auto !important; height: auto !important;
    }
    .dashboard-container.mobile-map-view .timeline-outer-wrapper { display: none !important; }

    /* Map tab: keep the nav bar visible so users can navigate pins + filter tracks.
       Re-enable the dropdown menu and chevron (both suppressed on the timeline tab). */
    .dashboard-container.mobile-map-view .floating-nav-menu { display: flex !important; }
    .dashboard-container.mobile-map-view .all-tracks-reset-btn svg { display: inline-flex !important; }

    /* Map tab discovery hint — sits between tab bar and timeline content */
    .mobile-tab-hint {
      display: block; font-size: 0.68rem; font-weight: 700; color: var(--tenki-blue);
      letter-spacing: 0.3px; text-align: center; padding: 4px 0 3px;
      opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
      flex-shrink: 0; order: 4; width: 100%; background: #f0f4f8;
      border-bottom: 1px solid rgba(0,90,156,0.1);
    }
    .mobile-tab-hint.visible { opacity: 1; }

    /* Push timeline below the hint strip (hint order: 4, tab bar: 4 earlier in DOM, timeline: 5) */
    .timeline-outer-wrapper { order: 5 !important; }
  }

  /* ── Mobile Landscape Layout ─────────────────────── */
  @media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
    .mobile-tab-bar { display: none !important; }

    .dashboard-container {
      display: grid !important;
      grid-template-areas: "header map" "controls map" "timeline map";
      grid-template-columns: 52% 48%;
      grid-template-rows: auto auto 1fr;
      height: 100dvh !important; max-height: 100dvh !important;
      overflow: hidden; padding: 0 !important; border-radius: 0 !important;
    }

    .dashboard-header { grid-area: header; padding: 6px 12px 4px !important; }
    .dashboard-header h2 { font-size: 0.95rem !important; }
    .dashboard-controls { grid-area: controls; }
    #system-state { grid-column: 1 / -1; }

    .map-interface-grid {
      grid-area: map; display: flex !important; flex-direction: column !important;
      height: 100% !important; flex: none !important; width: 100% !important;
      position: relative !important; border-bottom: none !important;
      border-left: 2px solid var(--timeline-line);
    }

    .timeline-outer-wrapper {
      grid-area: timeline; display: flex !important; position: relative !important;
      height: 100% !important; overflow: hidden !important; flex: none !important;
    }

    .floating-nav-container { display: none !important; }

    /* In landscape, always show both panels regardless of tab state */
    .dashboard-container.mobile-map-view .map-interface-grid { display: flex !important; }
    .dashboard-container.mobile-map-view .timeline-outer-wrapper { display: flex !important; }
    .dashboard-container.mobile-map-view .floating-nav-container { display: none !important; }
  }

  /* ── Funding Detail Modal ──────────────────────── */
  .funding-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9100; display: none;
    align-items: center; justify-content: center;
    padding: 20px;
  }
  .funding-modal-overlay.open { display: flex; }
  .funding-modal-panel {
    background: #fff; border-radius: 16px;
    max-width: 560px; width: 100%;
    max-height: 85vh; overflow-y: auto;
    padding: 28px; position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  }
  .funding-modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; color: #555; line-height: 1;
  }
  .funding-modal-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 4px; }
  .funding-modal-subtitle { font-size: 0.85rem; color: var(--text-light); margin: 0 0 20px; }
  .funding-chart-wrap { margin: 0 0 20px; }
  .funding-chart-label {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-light); margin-bottom: 6px;
  }
  .funding-bar-track {
    background: #e2e8f0; border-radius: 6px; height: 18px;
    overflow: hidden; margin-bottom: 8px;
  }
  .funding-bar-fill { height: 100%; border-radius: 6px; transition: width 0.8s ease; }
  .funding-bar-fill.raised { background: var(--tenki-green); }
  .funding-bar-fill.goal { background: var(--tenki-blue); }
  .funding-bar-fill.donated { background: #f59e0b; }
  .impact-metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px; margin-bottom: 20px;
  }
  .impact-metric-card {
    background: var(--bg-light); border-radius: 10px;
    padding: 12px 10px; text-align: center;
  }
  .impact-metric-icon { font-size: 1.4rem; }
  .impact-metric-value { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); }
  .impact-metric-label { font-size: 0.72rem; color: var(--text-light); }
  .impact-section-heading {
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-light); margin: 0 0 8px;
  }
  .impact-bullets { list-style: none; padding: 0; margin: 0 0 20px; }
  .impact-bullets li {
    padding: 4px 0 4px 20px; position: relative;
    font-size: 0.875rem; color: var(--text-dark);
  }
  .impact-bullets li::before { content: '✓'; position: absolute; left: 0; color: var(--tenki-green); font-weight: 700; }
  /* Team-members-involved strip on the event detail / funding popout.
     Photos are sourced from the cross-joined Team sheet; clicking jumps
     to /about-1#team-member-<slug>.  Tightly packed avatars with the
     name underneath — same shape as the org chart thumbnails. */
  .event-team-strip { display: flex; flex-wrap: wrap; gap: 12px;
                       margin: 0 0 20px; }
  .event-team-member { display: flex; flex-direction: column; align-items: center;
                        gap: 4px; padding: 6px 4px; border-radius: 8px;
                        text-decoration: none; color: inherit; cursor: pointer;
                        min-width: 78px;
                        transition: transform .25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                                    background-color .2s ease; }
  .event-team-member:hover { transform: translateY(-2px); background-color: #f0f7fb; }
  .event-team-member img,
  .event-team-avatar-fallback {
    width: 56px; height: 56px; border-radius: 50%;
    object-fit: cover; object-position: center top;
    background: #ddd; border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  .event-team-avatar-fallback { display: flex; align-items: center; justify-content: center;
                                  background: #3BA9E8; color: #fff; font-weight: 700;
                                  font-size: 18px; }
  .event-team-name { font-size: 11px; font-weight: 600; color: #333;
                      text-align: center; max-width: 76px; line-height: 1.2; }
  /* Members in the sheet without a matching Team row — render dimmed so
     the editor sees the typo / rename without breaking the rest of the strip. */
  .event-team-member.missing img,
  .event-team-member.missing .event-team-avatar-fallback {
    opacity: 0.4; filter: grayscale(1);
  }
  .event-team-member.missing .event-team-name { color: #b91c1c; font-style: italic; }

  /* "Powered By" partner strip — sibling of the team strip but with org
     logos in a wider plate.  Clicking opens the partner's website. */
  .event-partners-strip { display: flex; flex-wrap: wrap; gap: 14px;
                            margin: 0 0 20px; }
  .event-partner { display: flex; flex-direction: column; align-items: center;
                     gap: 4px; padding: 8px 10px; border-radius: 8px;
                     text-decoration: none; color: inherit; cursor: pointer;
                     min-width: 110px; max-width: 150px;
                     background: #fafafa; border: 1px solid #f0f0f0;
                     transition: transform .25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                                 box-shadow .25s ease, background-color .2s ease; }
  .event-partner:hover { transform: translateY(-2px);
                          box-shadow: 0 6px 14px rgba(0,0,0,.06);
                          background: #fff; }
  .event-partner img,
  .event-partner-logo-fallback {
    width: 88px; height: 50px; object-fit: contain;
    background: #fff; border-radius: 4px;
    padding: 4px;
  }
  .event-partner-logo-fallback {
    display: flex; align-items: center; justify-content: center;
    color: #1A1A1A; font-weight: 700; font-size: 11px;
    text-align: center; line-height: 1.1;
  }
  .event-partner-name { font-size: 11px; font-weight: 600; color: #333;
                          text-align: center; max-width: 130px; line-height: 1.2; }
  .event-partner-tier { font-size: 9px; font-weight: 700;
                          text-transform: uppercase; letter-spacing: .4px;
                          color: #888; }
  .event-partner.missing img,
  .event-partner.missing .event-partner-logo-fallback {
    opacity: 0.4; filter: grayscale(1);
  }
  .event-partner.missing .event-partner-name { color: #b91c1c; font-style: italic; }
  .scope-missed-box {
    background: #fff5f5; border-left: 4px solid #e53e3e;
    border-radius: 6px; padding: 12px 14px; margin-bottom: 20px;
  }
  .scope-missed-box h4 { font-size: 0.85rem; color: #c53030; margin: 0 0 6px; }
  .scope-missed-box p { font-size: 0.85rem; color: var(--text-dark); margin: 0; }
  .funding-modal-cta {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 14px;
    border: none; border-radius: 10px; cursor: pointer;
    font-size: 1rem; font-weight: 700; color: #fff;
    text-align: center; text-decoration: none; margin: 8px auto 0;
    box-sizing: border-box;
  }
  .funding-modal-cta.donate { background: var(--tenki-blue); }
  .funding-modal-cta.collaborate { background: var(--tenki-green); }
  .funding-disclaimer {
    font-size: 0.71rem; color: var(--text-light);
    text-align: center; margin: 10px 0 4px; font-style: italic;
  }

  /* ── CTA Return Toast ─────────────────────── */
  .link-toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--tenki-black); color: #fff;
    border-radius: 30px; padding: 11px 22px;
    display: flex; align-items: center; gap: 12px;
    font-size: 0.82rem; font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9500; opacity: 0; pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 92vw;
  }
  .link-toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
  .link-toast-close { background: none; border: none; color: rgba(255,255,255,0.65); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; }
  .link-toast-close:hover { color: #fff; }

  /* ── CTA hint below button group ─────────── */
  .cta-hint {
    font-size: 0.71rem; color: var(--text-light);
    text-align: center; margin: 6px 0 0; letter-spacing: 0.2px;
  }