:root{
  --paper:#f7f2e8;
  --ink:#1f2a2a;
  --muted:#6d716b;
  --line:#d7d0c2;
  --panel:#fffdf7;
  --water:#dce9e7;
  --land:#f0eadf;
  --country-line:#c6bdae;
  --accent:#d54d3f;
  --accent-2:#157d78;
  --gold:#c8972f;
  --shadow:0 16px 50px rgba(56,50,39,.12);
  --science:#3467eb;
  --community:#d54d3f;
  --creative:#9b59b6;
  --everyday:#d28a25;
  --climate:#16866f;
  --other:#69726d;
  --radius:18px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink)}
body{padding:18px}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
.masthead{max-width:1500px;margin:0 auto 14px;display:flex;justify-content:space-between;gap:24px;align-items:flex-start}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.72rem;font-weight:800;color:var(--accent-2);margin:.1rem 0 .4rem}
h1{font-size:clamp(2rem,4vw,4.8rem);line-height:.93;letter-spacing:-.055em;margin:0;max-width:920px}
.dek{max-width:760px;font-size:clamp(1rem,1.3vw,1.25rem);color:var(--muted);margin:.75rem 0 0}
.page-shell{max-width:1500px;margin:auto;display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px}
.map-card,.idea-panel{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow)}
.map-card{border-radius:var(--radius);overflow:hidden;min-width:0}
.idea-panel{border-radius:var(--radius);padding:22px;display:flex;flex-direction:column;gap:22px}
.status-strip{min-height:34px;padding:8px 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;font-size:.85rem;color:var(--muted)}
.mode-hint{font-weight:700;color:var(--accent)}
.counter-row{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line)}
.counter-row div{padding:12px 16px;border-right:1px solid var(--line);display:flex;align-items:baseline;gap:8px}
.counter-row div:last-child{border-right:0}
.counter-row strong{font-size:clamp(1.6rem,3vw,3.2rem);line-height:1}
.counter-row span{font-size:.82rem;color:var(--muted)}
.map-wrap{position:relative;height:min(68vh,760px);min-height:480px;background:var(--water);overflow:hidden}
#map{width:100%;height:100%;display:block;touch-action:none}
.country{fill:var(--land);stroke:var(--country-line);stroke-width:.5;vector-effect:non-scaling-stroke}
.country:hover{fill:#ece4d6}
.sphere{fill:var(--water)}
.idea-point{stroke:#fffdf7;stroke-width:1.7;vector-effect:non-scaling-stroke;cursor:pointer}
.idea-point:hover,.idea-point:focus{stroke:var(--ink);stroke-width:2.3}
.idea-point.borrowed{stroke:var(--ink);stroke-width:2.5}
.flow{fill:none;stroke:var(--accent-2);stroke-width:1.1;stroke-opacity:.2;vector-effect:non-scaling-stroke;pointer-events:none}
.flow.active{stroke:var(--accent);stroke-width:2.2;stroke-opacity:.85;stroke-dasharray:7 8;animation:dash 1.15s linear infinite}
@keyframes dash{to{stroke-dashoffset:-30}}
@media (prefers-reduced-motion:reduce){.flow.active{animation:none}}
.map-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 14px;border-top:1px solid var(--line)}
.primary-button,.secondary-button,.ghost-button{min-height:44px;border-radius:999px;padding:10px 16px;border:1px solid var(--ink);font-weight:800}
.primary-button{background:var(--ink);color:white}
.secondary-button{background:var(--accent-2);border-color:var(--accent-2);color:white}
.ghost-button{background:transparent;color:var(--ink)}
.wide{width:100%;justify-content:center}
.toggle{display:flex;align-items:center;gap:8px;margin-left:auto;font-weight:700;font-size:.9rem}
.toggle input{width:18px;height:18px}
.legend{border-top:1px solid var(--line);padding:10px 14px 14px}
.legend summary{font-weight:800;cursor:pointer}
.legend-grid{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:10px;font-size:.82rem}
.legend-grid span{display:flex;align-items:center;gap:7px}
.dot,.borrow-ring,.flow-swatch{width:12px;height:12px;display:inline-block}
.dot{border-radius:50%;border:2px solid white;box-shadow:0 0 0 1px rgba(0,0,0,.12)}
.dot-science{background:var(--science)}.dot-community{background:var(--community)}.dot-creative{background:var(--creative)}.dot-everyday{background:var(--everyday)}.dot-climate{background:var(--climate)}.dot-other{background:var(--other)}
.borrow-ring{border:2px solid var(--ink);border-radius:50%;background:transparent}
.flow-swatch{height:2px;width:22px;background:var(--accent-2)}
.empty-state h2,.idea-panel h2,.dialog-card h2{font-size:1.65rem;letter-spacing:-.03em;margin:.25rem 0 .6rem}
.empty-state p,.form-note,.how-it-works,.idea-meta,.safety-note{color:var(--muted);line-height:1.5}
.pill{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:5px 9px;font-size:.76rem;font-weight:800;margin:0}
.idea-body{font-size:1.08rem;line-height:1.55}
.idea-meta{margin:16px 0 0}
.idea-meta div{padding:10px 0;border-top:1px solid var(--line)}
.idea-meta dt{font-size:.72rem;text-transform:uppercase;letter-spacing:.09em;font-weight:800}
.idea-meta dd{margin:4px 0 0;color:var(--ink);font-weight:700}
.how-it-works{margin-top:auto;border-top:1px solid var(--line);padding-top:16px}
.how-it-works h3{color:var(--ink)}
.how-it-works ol{padding-left:1.2rem}
.dialog-card{width:min(92vw,560px);border:0;border-radius:22px;padding:24px;background:var(--panel);box-shadow:0 20px 80px rgba(0,0,0,.25)}
.dialog-card::backdrop{background:rgba(31,42,42,.5);backdrop-filter:blur(3px)}
.dialog-card form{display:grid;gap:14px}
.dialog-close{position:absolute;right:14px;top:12px;width:42px;height:42px;border-radius:50%;border:1px solid var(--line);background:var(--panel);font-size:1.5rem}
.dialog-card label{display:grid;gap:6px;font-weight:800}
.dialog-card input,.dialog-card select,.dialog-card textarea{width:100%;border:1px solid #bfb7a9;border-radius:12px;padding:12px;background:white;color:var(--ink)}
.dialog-card textarea{min-height:120px;resize:vertical}
.location-row{display:flex;gap:8px;flex-wrap:wrap}
.location-label{background:#f0eadf;border-radius:12px;padding:10px 12px;margin:0;font-size:.9rem}
.safety-note{font-size:.78rem;margin:0}
.error-text{min-height:1.2em;color:#a92d25;font-weight:700;margin:0}
.tooltip{position:absolute;z-index:20;pointer-events:none;max-width:230px;background:var(--ink);color:#fff;padding:9px 11px;border-radius:10px;font-size:.78rem;box-shadow:var(--shadow)}
.about-dialog code{font-size:.85em}
.about-dialog a{color:var(--accent-2);font-weight:800}
.credit{font-weight:700}
@media (max-width:900px){
  body{padding:10px}
  .masthead{align-items:center}
  .page-shell{grid-template-columns:1fr}
  .idea-panel{order:-1;padding:15px}
  .how-it-works{display:none}
  .map-wrap{min-height:54vh;height:58vh}
}
@media (max-width:600px){
  .masthead{display:block}
  .masthead>.ghost-button{margin-top:12px}
  .counter-row div{display:block;padding:10px}
  .counter-row strong{display:block}
  .counter-row span{display:block;margin-top:3px}
  .toggle{width:100%;margin-left:0}
  .legend-grid{display:grid;grid-template-columns:1fr 1fr}
}


/* Compact first-viewport refinement */
.masthead{max-width:1500px;margin:0 auto 10px;min-height:0;align-items:flex-start}
.masthead-copy{min-width:0}
h1{font-size:clamp(1.9rem,3.3vw,3.9rem);line-height:.96;letter-spacing:-.05em}
.dek{max-width:760px;font-size:clamp(.95rem,1.05vw,1.12rem);line-height:1.35;margin:.48rem 0 0}
.masthead .eyebrow{margin:0 0 .28rem;font-size:.68rem}
.about-icon{display:none}
.visit-directions{padding:9px 14px;border-bottom:1px solid var(--line);background:#f3eee3;color:var(--muted);font-size:.88rem;line-height:1.35}
.visit-directions strong{color:var(--ink)}
.map-wrap{height:min(62vh,690px);min-height:430px}
.idea-panel{padding:18px}
.status-strip{min-height:30px;padding:6px 12px}
.counter-row div{padding:9px 14px}
.map-toolbar{padding:9px 12px}
.legend{padding:8px 12px 11px}

@media (min-width:901px) and (min-height:700px){
  .page-shell{height:calc(100vh - 122px);min-height:560px}
  .map-card,.idea-panel{height:100%}
  .map-card{display:flex;flex-direction:column}
  .map-wrap{flex:1 1 auto;height:auto;min-height:0}
  .legend{flex:0 0 auto}
}
@media (max-width:900px){
  body{padding-top:8px}
  .masthead{position:relative;padding-right:48px;margin-bottom:8px}
  h1{font-size:clamp(1.9rem,9vw,3rem)}
  .dek{font-size:.98rem;line-height:1.32;margin-top:.42rem}
  .about-button{position:fixed;z-index:1000;top:max(10px, env(safe-area-inset-top));right:max(10px, env(safe-area-inset-right));width:40px;height:40px;min-height:40px;padding:0;display:grid;place-items:center;border-radius:50%;background:var(--panel);box-shadow:0 6px 18px rgba(31,42,42,.16)}
  .about-label{display:none}
  .about-icon{display:inline;font-family:Georgia,serif;font-size:1.15rem;font-weight:800;line-height:1}
  .visit-directions{font-size:.82rem;padding:8px 10px}
  .idea-panel{padding:12px 14px}
  .empty-state h2,.idea-panel h2{font-size:1.35rem}
  .map-wrap{height:52vh;min-height:390px}
}
@media (max-width:600px){
  .masthead>.ghost-button{margin-top:0}
  .masthead .eyebrow{font-size:.63rem}
  h1{font-size:clamp(1.75rem,8.5vw,2.5rem)}
  .dek{font-size:.93rem}
  .counter-row strong{font-size:1.45rem}
  .counter-row span{font-size:.7rem}
  .map-wrap{min-height:360px;height:50vh}
}
