:root{
    --cream: #fdf7ef;
    --white: #ffffff;
    --teal: #0cb8ae;
    --teal-light: #26c7b8;
    --teal-pale: #e2f6f3;
    --coral: #fd6b54;
    --coral-pale: #ffe6e0;
    --blue: #0e8ac2;
    --blue-pale: #e3f2fa;
    --gold: #fab930;
    --gold-pale: #fef3dc;
    --navy: #03547b;
    --ink: #0d3a52;
    --ink-soft: #5c7f8f;
    --line: #e7ddca;
    --unconf: #b9c4c9;
    --shadow-sm: 0 2px 10px rgba(3,84,123,0.08);
    --shadow-md: 0 14px 34px -12px rgba(3,84,123,0.25);
    --radius: 18px;
  }

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background: var(--cream);
    color: var(--ink);
    font-family: 'Nunito Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  ::selection{ background: var(--gold); color: var(--navy); }

  h1,h2,h3,h4{
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
  }

  a{ color: var(--blue); }

  /* honeycomb backdrop texture */
  .honeycomb-bg{
    background-image: radial-gradient(circle at 1px 1px, rgba(3,84,123,0.06) 1.4px, transparent 1.4px);
    background-size: 26px 26px;
  }

  /* ---------- Hero ---------- */
  header.hero{
    padding: 46px clamp(20px, 5vw, 70px) 10px;
    max-width: 1400px;
    margin: 0 auto;
  }
  .hero-banner{
    display:flex;
    align-items:center;
    gap: 28px;
    flex-wrap: wrap;
  }
  .hero-banner img{
    width: min(420px, 42vw);
    min-width: 260px;
    height: auto;
    display:block;
  }
  .hero-copy{
    flex: 1;
    min-width: 260px;
  }
  .eyebrow-pill{
    display:inline-flex;
    align-items:center;
    gap: 8px;
    background: var(--teal-pale);
    color: var(--teal);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.03em;
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
  }
  .eyebrow-pill .hexdot{
    width: 10px; height: 10px;
    background: var(--teal);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    flex-shrink:0;
  }
  .hero-copy p.lede{
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0;
    font-weight: 500;
  }

  .stat-strip{
    display:flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 26px;
  }
  .stat-hex{
    position: relative;
    width: 122px;
    height: 106px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color: #fff;
    text-align:center;
    padding: 0 10px;
  }
  .stat-hex .num{ font-family:'Baloo 2',sans-serif; font-size: 26px; font-weight:800; line-height:1; }
  .stat-hex .label{ font-size: 10px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; margin-top:5px; opacity:0.95; }
  .stat-hex.c1{ background: var(--teal); }
  .stat-hex.c2{ background: var(--blue); }
  .stat-hex.c3{ background: var(--coral); }
  .stat-hex.c4{ background: var(--gold); color: var(--navy); }

  /* ---------- Layout ---------- */
  main.map-layout{
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px clamp(20px, 5vw, 70px) 10px;
    display:grid;
    grid-template-columns: minmax(0,1.55fr) minmax(340px, 1fr);
    gap: 22px;
  }
  @media (max-width: 940px){
    main.map-layout{ grid-template-columns: 1fr; }
  }

  .map-card{
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
  }
  #map{
    height: min(74vh, 660px);
    min-height: 440px;
    width: 100%;
    background: var(--teal-pale);
  }
  @media (max-width: 940px){
    #map{ height: 58vh; }
  }

  .map-caption{
    position:absolute;
    left:16px;
    bottom:16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(3px);
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    z-index: 500;
    box-shadow: var(--shadow-sm);
    max-width: 230px;
    line-height:1.5;
  }

  .legend{
    position:absolute;
    top:16px;
    right:16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(3px);
    border-radius: 14px;
    padding: 12px 15px;
    z-index:500;
    box-shadow: var(--shadow-sm);
    font-size: 12.5px;
  }
  .legend-title{
    font-family:'Baloo 2', sans-serif;
    font-size:11px;
    font-weight: 700;
    text-transform:uppercase;
    letter-spacing:0.05em;
    color: var(--navy);
    margin-bottom:8px;
  }
  .legend-row{
    display:flex; align-items:center; gap:8px; margin-bottom:6px;
    font-weight:600;
    color: var(--ink);
  }
  .legend-row:last-child{ margin-bottom:0; }
  .legend-hex{
    width:13px; height:13px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    flex-shrink:0;
  }

  /* ---------- Detail Panel ---------- */
  .panel{
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display:flex;
    flex-direction:column;
    height: min(74vh, 660px);
    min-height: 440px;
    overflow-y:auto;
  }
  @media (max-width: 940px){
    .panel{ height: auto; max-height: 68vh; }
  }

  .panel-empty{
    margin:auto;
    text-align:center;
    padding: 40px 30px;
    color: var(--ink-soft);
  }
  .panel-empty h4{ font-size: 16px; margin-bottom: 18px; }
  .panel-empty .stat-strip{
    display:grid;
    grid-template-columns: repeat(2, 122px);
    justify-content:center;
    margin: 0 0 22px;
  }
  .panel-empty p{
    font-size: 13.5px;
    line-height:1.6;
    max-width: 300px;
    margin: 0 auto;
    font-weight: 500;
  }

  .card{
    display:none;
    padding: 26px 26px 34px;
  }
  .card.active{ display:block; }

  .card-eyebrow{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .status-chip{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 5px 12px 5px 9px;
    border-radius: 999px;
    font-size:11px;
    font-weight:800;
    letter-spacing:0.03em;
    text-transform:uppercase;
    color:#fff;
  }
  .status-chip .hexdot{
    width:8px; height:8px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: rgba(255,255,255,0.9);
  }
  .scope-pill{
    font-size: 11px;
    font-weight:700;
    color: var(--ink-soft);
    background: var(--cream);
    padding: 5px 10px;
    border-radius: 999px;
  }

  .card h2{
    font-size: 24px;
    line-height:1.2;
    margin: 0 0 6px;
  }
  .card .loc{
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 16px;
  }

  .card .mandate-block{
    background: var(--teal-pale);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14.5px;
    line-height:1.6;
    font-weight: 600;
    color: var(--navy);
  }

  .card .description-block{
    font-size: 13.5px;
    line-height:1.6;
    font-weight: 500;
    color: var(--ink-soft);
    margin: 0 0 14px;
    white-space: pre-line;
  }

  .facts{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    margin-bottom: 20px;
  }
  .fact{
    background: var(--cream);
    border-radius: 12px;
    padding: 10px 12px;
  }
  .fact .k{
    font-size: 10px;
    font-weight: 800;
    text-transform:uppercase;
    letter-spacing:0.04em;
    color: var(--ink-soft);
    margin-bottom: 3px;
  }
  .fact .v{
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    line-height:1.4;
  }
  .fact .v.empty{
    color: var(--ink-soft);
    font-weight:600;
    font-style: italic;
  }

  .divider-row{
    display:flex;
    align-items:center;
    gap:10px;
    margin: 22px 0 12px;
  }
  .divider-row .hexdiv{
    width:9px; height:9px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--gold);
    flex-shrink:0;
  }
  .divider-row .lbl{
    font-family:'Baloo 2', sans-serif;
    font-size:13px;
    font-weight: 700;
    color: var(--navy);
  }

  .org-block p{
    font-size:13.5px;
    line-height:1.6;
    margin: 0 0 10px;
    font-weight: 500;
  }
  .org-block .role{
    font-size:10px;
    font-weight: 800;
    text-transform:uppercase;
    letter-spacing:0.04em;
    color: var(--teal);
    display:block;
    margin-bottom:2px;
  }

  .card-links{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top: 20px;
  }
  .card-links a{
    font-size: 12.5px;
    font-weight: 700;
    text-decoration:none;
    background: var(--navy);
    border-radius: 999px;
    padding: 10px 16px;
    color: #fff;
    display:inline-flex;
    align-items:center;
    gap:6px;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .card-links a:hover{
    background: var(--teal);
    transform: translateY(-1px);
  }

  /* ---------- Filter / List Section ---------- */
  section.roster{
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px clamp(20px,5vw,70px) 70px;
  }
  .roster-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    flex-wrap:wrap;
    gap: 14px;
    margin-bottom: 22px;
  }
  .roster-head h3{ font-size: 22px; }
  .filters{
    display:flex;
    gap:9px;
    flex-wrap:wrap;
  }
  .filter-btn{
    font-family: 'Nunito Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    background: var(--white);
    border: none;
    color: var(--ink-soft);
    padding: 9px 15px;
    border-radius: 999px;
    cursor:pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
  }
  .filter-btn:hover{ color: var(--navy); }
  .filter-btn.active{
    background: var(--navy);
    color: #fff;
  }

  .roster-grid{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
  }
  .roster-item{
    background: var(--white);
    border-radius: 16px;
    padding: 18px 18px 16px;
    cursor:pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display:flex;
    flex-direction:column;
    min-height: 150px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
  }
  .roster-item:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .roster-item.selected{ border-color: var(--teal); }
  .roster-item .ri-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    margin-bottom:10px;
  }
  .roster-item .ri-num{
    font-family:'Baloo 2', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
  }
  .roster-item h4{
    font-size:16px;
    margin: 0 0 6px;
    line-height:1.25;
  }
  .roster-item .ri-loc{
    font-size:12px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom:10px;
  }
  .roster-item .ri-topic{
    font-size:12.5px;
    font-weight: 600;
    color: var(--ink);
    margin-top:auto;
    padding-top:10px;
    border-top: 1.5px dashed var(--line);
  }

  .status-tag{
    display:inline-flex;
    align-items:center;
    gap:5px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 9px;
    border-radius: 999px;
    color:#fff;
  }
  .status-tag .hexdot{
    width:6px; height:6px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: rgba(255,255,255,0.9);
  }

  footer{
    padding: 26px clamp(20px,5vw,70px) 44px;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;
  }

  /* Leaflet marker override - hexagon pins */
  .assembly-pin{
    width: 22px; height: 22px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(3,84,123,0.35);
  }
  .assembly-pin.selected-pin{
    width:30px; height:30px;
    box-shadow: 0 0 0 5px rgba(253,107,84,0.25), 0 2px 10px rgba(3,84,123,0.4);
  }
  .leaflet-popup-content-wrapper{
    background: var(--white);
    border-radius: 14px;
    font-family: 'Nunito Sans', sans-serif;
  }
  .leaflet-popup-tip{ background: var(--white); }
  .leaflet-popup-content{
    margin: 13px 15px;
    font-size: 13px;
  }
  .popup-name{
    font-family:'Baloo 2', sans-serif;
    font-weight:700;
    font-size:15px;
    color: var(--navy);
    margin-bottom:3px;
  }
  .popup-loc{ color:var(--ink-soft); font-weight:600; font-size:12px; margin-bottom:8px; }
  .popup-btn{
    font-size:11.5px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:0.03em;
    cursor:pointer;
    color: #fff;
    background: var(--coral);
    padding: 6px 12px;
    border-radius: 999px;
    display:inline-block;
  }

  /* ---------- Site nav ---------- */
  nav.sitenav{
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px clamp(20px, 5vw, 70px) 0;
    display:flex;
    align-items:center;
    gap: 22px;
    flex-wrap: wrap;
  }
  nav.sitenav .brand{
    font-family:'Baloo 2', sans-serif;
    font-weight:800;
    font-size: 15px;
    color: var(--navy);
    text-decoration:none;
    margin-right: auto;
  }
  nav.sitenav a.navlink{
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-soft);
    text-decoration:none;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
  }
  nav.sitenav a.navlink:hover{ color: var(--navy); }
  nav.sitenav a.navlink.current{
    color: var(--navy);
    border-bottom-color: var(--teal);
  }

  /* ---------- Scope note ---------- */
  .scope-note{
    display:flex;
    align-items:flex-start;
    gap:10px;
    background: var(--gold-pale);
    border-radius: 14px;
    padding: 12px 16px;
    margin: 0 auto;
    max-width: 780px;
    font-size: 13px;
    line-height:1.55;
    font-weight: 600;
    color: var(--navy);
  }
  .scope-note .hexdot{
    width:10px; height:10px;
    margin-top:3px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--gold);
    flex-shrink:0;
  }

  /* ---------- Submit / correct section ---------- */
  section.submit-section, section.note-section{
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(20px,5vw,70px);
  }
  section.note-section{
    padding-top: 22px;
    padding-bottom: 26px;
  }
  section.submit-section{
    padding-bottom: 20px;
  }
  .submit-card{
    background: var(--navy);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 30px clamp(22px, 4vw, 40px);
    color: #fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap: 26px;
    flex-wrap:wrap;
  }
  .submit-card h3{
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
  }
  .submit-card p{
    font-size: 13.5px;
    line-height:1.6;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    max-width: 520px;
    margin: 0;
  }
  .submit-card .actions{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap: 8px;
  }
  .submit-card .actions a{
    font-size: 13px;
    font-weight: 800;
    text-decoration:none;
    background: var(--teal);
    color: #fff;
    padding: 11px 18px;
    border-radius: 999px;
    display:inline-flex;
    align-items:center;
    gap:7px;
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
  }
  .submit-card .actions a:hover{ background: var(--teal-light); transform: translateY(-1px); }
  .submit-card .actions .csv-note{
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
  }
  @media (max-width: 700px){
    .submit-card{ flex-direction:column; align-items:flex-start; }
  }

  /* ---------- Generic content page (About / Resources / Changelog) ---------- */
  main.page{
    max-width: 880px;
    margin: 0 auto;
    padding: 10px clamp(20px, 5vw, 70px) 60px;
  }
  main.page h1{
    font-size: 30px;
    margin-bottom: 10px;
  }
  main.page .page-lede{
    font-size: 15.5px;
    line-height:1.65;
    color: var(--ink-soft);
    font-weight: 500;
    max-width: 640px;
    margin-bottom: 30px;
  }
  main.page .content-card{
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 30px clamp(22px, 4vw, 40px);
    margin-bottom: 20px;
  }
  main.page .content-card h2{
    font-size: 18px;
    margin-bottom: 10px;
  }
  main.page .content-card h2:not(:first-child){ margin-top: 22px; }
  main.page .content-card p{
    font-size: 14.5px;
    line-height:1.7;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 14px;
  }
  main.page .content-card p:last-child{ margin-bottom:0; }
  main.page .content-card ul{
    margin: 0 0 14px;
    padding-left: 20px;
  }
  main.page .content-card li{
    font-size: 14.5px;
    line-height:1.7;
    font-weight: 500;
    margin-bottom: 6px;
  }

  .wip-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background: var(--coral-pale);
    color: var(--coral);
    font-weight: 800;
    font-size: 12px;
    letter-spacing:0.03em;
    text-transform:uppercase;
    padding: 8px 15px;
    border-radius: 999px;
    margin-bottom: 22px;
  }
  .wip-badge .hexdot{
    width:9px; height:9px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--coral);
    flex-shrink:0;
  }

  footer .footer-links{
    display:flex;
    gap: 14px;
    flex-wrap:wrap;
  }
  footer a{
    color: var(--ink-soft);
    font-weight: 700;
  }
  footer a:hover{ color: var(--navy); }

  /* ---------- Directory popup modal ---------- */
  .modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(3,84,123,0.55);
    backdrop-filter: blur(2px);
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 24px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .modal-overlay.open{
    opacity: 1;
    pointer-events: auto;
  }
  .modal-box{
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display:flex;
    flex-direction:column;
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.2s ease;
  }
  .modal-overlay.open .modal-box{
    transform: translateY(0);
  }
  .modal-scroll{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .modal-close{
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--cream);
    color: var(--navy);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index: 5;
    transition: background 0.15s ease;
  }
  .modal-close:hover{ background: var(--teal-pale); }
  #modalCard{ padding-top: 46px; }
