/*
 * BIMBY — "Your backyard"
 * One question first (where is your backyard?), then two levels of answer
 * (near you / your ecoregion), then butterflies as photo cards that open in place.
 */
:root {
  --green-900: #22301b;
  --green-800: #33472a;
  --green-100: #e2ecd9;
  --accent: #e79a3c;
  --accent-ink: #2b1d06;
  --link: #8a4a0c;
  --inat: #3f7cac;
  /* iNaturalist dots on the map */

  --bg: #fbfaf6;
  --ink: #1f261b;
  --dim: #5c6556;
  --line: #e4e1d6;
  --soft: #f1efe7;
  --focus: #2f6fdd;

  --panel-w: 50vw;
  /* default; the divider lets people drag it (saved per browser) */
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#layout {
  display: flex;
  height: 100vh;
}

/* ---------- Panel ---------- */
#panel {
  width: var(--panel-w);
  flex: 0 0 var(--panel-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 1001;
  min-width: 360px;
}

/* Drag handle between the panel and the map */
#resizer {
  flex: 0 0 10px;
  margin: 0 -5px;
  position: relative;
  z-index: 1002;
  cursor: col-resize;
  background: transparent;
  border: 0;
  padding: 0;
  touch-action: none;
}

#resizer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 44px;
  border-radius: 3px;
  background: var(--line);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

#resizer:hover::after,
#resizer:focus-visible::after,
#resizer.dragging::after {
  background: var(--green-800);
}

#resizer:focus-visible {
  outline: none;
}

body.resizing {
  cursor: col-resize;
  user-select: none;
}

body.resizing #map {
  pointer-events: none;
}

.app-head {
  background: var(--green-800);
  color: #f4f6f0;
  padding: 16px 22px 14px;
}

.app-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* Home button under the map's zoom buttons */
.home-ctl a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.home-ctl svg.icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.4;
}

/* The title is the home link: it starts the page over */
.app-title a {
  color: inherit;
  text-decoration: none;
}

.app-title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.app-title a:focus-visible {
  outline: 2px solid #f4f6f0;
  outline-offset: 3px;
  border-radius: 2px;
}

.app-sub {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 2px;
}

/* Link to the guessing game (game/), under the subtitle */
.app-game {
  font-size: 13px;
  margin-top: 6px;
}

.app-game a {
  color: inherit;
  text-underline-offset: 3px;
}

.app-game a:hover {
  color: var(--accent);
}

.app-game a:focus-visible {
  outline: 2px solid #f4f6f0;
  outline-offset: 3px;
  border-radius: 2px;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 28px;
}

h2.lead {
  font-size: 24px;
  line-height: 1.2;
  margin: 6px 0 6px;
  letter-spacing: -0.01em;
}

p.sub {
  color: var(--dim);
  margin: 0 0 18px;
}

.search {
  display: flex;
  gap: 8px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #cfcabc;
  border-radius: 10px;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: var(--green-800);
  color: #fff;
}

.btn.primary:hover {
  background: var(--green-900);
}

.btn.secondary {
  background: #fff;
  border: 1px solid #cfcabc;
  color: var(--ink);
  font-weight: 500;
}

.btn.secondary:hover {
  background: var(--soft);
}

.btn.full {
  width: 100%;
}

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 13px;
  margin: 14px 0;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.hint {
  color: var(--dim);
  font-size: 13px;
  margin: 12px 0 0;
}

.msg {
  color: #8a2a0c;
  font-size: 13px;
  margin: 8px 0 0;
}

.matches {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.matches li+li {
  border-top: 1px solid var(--line);
}

.matches button {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  padding: 10px 12px;
  cursor: pointer;
}

.matches button:hover {
  background: var(--soft);
}

.matches small {
  display: block;
  color: var(--dim);
}

.canada {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.canada b {
  color: var(--ink);
}

.canada p {
  margin: 0;
}

#ecoInfo {
  font-size: 13px;
  margin-bottom: 6px;
}

/* Which data sources to show */
.src-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--dim);
}

.src-pick .seg {
  margin-bottom: 0;
}

.src-pick .seg button {
  padding: 5px 12px;
}

.src-pick small {
  font-size: 12px;
}

/* Place + summary */
.place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.place .name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
}

.scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.tile {
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 11px;
  cursor: pointer;
  position: relative;
}

.tile:hover {
  border-color: #cfcabc;
}

.tile[aria-disabled="true"] {
  cursor: default;
  opacity: 0.7;
}

.tile[aria-pressed="true"] {
  border-color: var(--green-800);
  box-shadow: inset 0 0 0 1px var(--green-800);
  background: #f6f9f2;
}

.tile .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.tile .t {
  font-weight: 600;
  margin: 2px 0 6px;
  font-size: 14px;
  line-height: 1.25;
}

.tile .n {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.tile .n small {
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
}

.tile .s {
  font-size: 12px;
  color: var(--dim);
}

.tile select {
  border: 0;
  background: transparent;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.trend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px 4px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.trend-btn:hover,
.trend-btn[aria-expanded="true"] {
  background: var(--green-100);
  border-color: #b9cba8;
}

.trend-btn svg.icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

/* Collapsible sections inside a butterfly's detail */
details.sec {
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

details.sec>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

details.sec>summary::-webkit-details-marker {
  display: none;
}

details.sec>summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin: 0 3px 0 2px;
}

details.sec[open]>summary::before {
  transform: rotate(45deg);
}

details.sec>summary:hover {
  color: var(--ink);
}

details.sec>summary .hint-r {
  margin-left: auto;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

/* Keep charts at a readable size when the panel is dragged wide */
.detail .chart {
  max-width: 520px;
}

.chart-sub {
  font-size: 12px;
  color: var(--dim);
  margin: 0 0 6px;
}

/* ---------- Trends drawer (slides out from the panel over the map) ---------- */
#trends,
#flowers {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(580px, 94%);
  background: var(--bg);
  z-index: 1100;
  /* above Leaflet's controls (1000) */
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 22px rgba(0, 0, 0, 0.2);
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

#trends.open,
#flowers.open {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease;
}

.tr-head {
  background: var(--green-800);
  color: #f4f6f0;
  padding: 14px 18px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tr-head .ttl {
  flex: 1;
  min-width: 0;
}

.tr-head h2 {
  margin: 0;
  font-size: 17px;
}

.tr-head .where {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

.tr-head .close-btn {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.tr-head .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tr-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 22px;
}

.tr-body .seg {
  margin-bottom: 14px;
}

.tr-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tr-stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.tr-stats b {
  display: block;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.tr-stats span {
  font-size: 12px;
  color: var(--dim);
}

.tr-chart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  margin-bottom: 14px;
}

.tr-chart h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.explain {
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 10px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0 6px;
}

.filters input[type=search] {
  flex: 1 1 160px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #cfcabc;
  border-radius: 8px;
  background: #fff;
}

.filters select {
  padding: 8px 8px;
  border: 1px solid #cfcabc;
  border-radius: 8px;
  background: #fff;
}

.filters select.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.count-line {
  font-size: 13px;
  color: var(--dim);
  margin: 6px 0 10px;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: #cfcabc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.card .ph {
  aspect-ratio: 4 / 3;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a9a8f;
  font-size: 12px;
  position: relative;
}

.card .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .meta {
  padding: 9px 11px 11px;
}

.card .cn {
  font-weight: 600;
  line-height: 1.25;
}

.card .sn {
  font-style: italic;
  color: var(--dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .ct {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
}

/* Expanded card (spans the whole row) */
.detail {
  grid-column: 1 / -1;
  background: #fff;
  border: 1.5px solid var(--green-800);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  scroll-margin-top: 12px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.detail-head .names {
  flex: 1;
  min-width: 0;
}

.detail-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.detail-head .sn {
  font-style: italic;
  color: var(--dim);
}

.close-btn {
  background: var(--soft);
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}

.close-btn:hover {
  background: var(--line);
}

.detail h4 {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 18px 0 6px;
}

.detail h4.plants-head {
  margin-top: 22px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--dim);
  margin-top: 6px;
}

.facts b {
  color: var(--ink);
  font-weight: 600;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart text {
  font-size: 11px;
  fill: var(--dim);
  font-family: inherit;
}

.chart text.now {
  fill: var(--ink);
  font-weight: 700;
}

.chart .bar {
  fill: var(--accent);
}

.chart .bar.now {
  fill: #b8691c;
}

.seg {
  display: inline-flex;
  border: 1px solid #cfcabc;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.seg button {
  background: #fff;
  border: 0;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
}

.seg button+button {
  border-left: 1px solid #cfcabc;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

ul.plants {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.plants li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #eeebe2;
  font-size: 14px;
}

ul.plants i {
  color: var(--dim);
}

/* ---------- Flowers butterflies were seen at ---------- */
.plants-sub {
  margin: 14px 0 2px;
  font-size: 14px;
}

.fl-name i {
  color: var(--dim);
  margin-left: 2px;
}

/* "any species" after a genus in the host plant lists */
.fl-name .any {
  color: var(--dim);
  font-size: 12px;
}

/* Host Plants / Flowers tabs at the top of the plants drawer */
.fl-tabs {
  margin-bottom: 14px;
}

.more-btn {
  font-size: 13px;
  margin-top: 8px;
}

.fl-open {
  margin: -4px 0 10px;
}

.canada .fl-open {
  margin: 10px 0 0;
}

.fl-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.tr-body .fl-controls .seg {
  margin-bottom: 0;
}

ol.fl-list {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.fl-row+.fl-row {
  border-top: 1px solid #eeebe2;
}

.fl-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.fl-head:hover,
.fl-row.open .fl-head {
  background: var(--soft);
}

.fl-head .rank {
  flex: 0 0 24px;
  color: var(--dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.fl-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
}

.fl-nums {
  font-size: 12px;
  color: var(--dim);
}

ul.fl-bf {
  list-style: none;
  margin: 0;
  padding: 2px 12px 10px 46px;
  background: var(--soft);
  font-size: 13px;
}

ul.fl-bf li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
}

ul.fl-bf .n {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

ul.plants .seen {
  color: var(--dim);
  white-space: nowrap;
  font-size: 13px;
}

.note {
  font-size: 13px;
  color: var(--dim);
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.cite {
  font-size: 11px;
  color: var(--dim);
  margin-top: 8px;
}

.cite a,
.about a,
.canada a,
.empty a {
  color: var(--link);
}

.map-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.map-row .s {
  font-size: 13px;
  color: var(--dim);
}

.empty {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--dim);
  font-size: 14px;
}

details.about {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
  color: var(--dim);
}

details.about summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

details.about p {
  margin: 8px 0 0;
}

/* ---------- Map ---------- */
#mapwrap {
  flex: 1;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

.you-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-800);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.map-banner {
  background: var(--green-900);
  color: #f4f6f0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-banner .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid #fff;
}

.map-banner .dot.inat {
  background: var(--inat);
}

.map-banner .key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-banner button {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}

.map-banner button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.map-hint {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.leaflet-tooltip {
  font-family: inherit;
}

/* ---------- Phones: map on top, results below ---------- */
@media (max-width: 800px) {
  #layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  #mapwrap {
    order: 1;
    flex: 0 0 42vh;
    height: 42vh;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  #resizer {
    display: none;
  }

  #panel {
    order: 2;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    height: auto;
    border-right: 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    margin-top: -14px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 2;
  }

  .app-head {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }

  #content {
    overflow: visible;
  }

  #trends,
  #flowers {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 3000;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .scope {
    grid-template-columns: 1fr;
  }
}

/* ---------- Drawing an area ---------- */
.leaflet-container.drawing,
.leaflet-container.drawing .leaflet-grab,
.leaflet-container.drawing .leaflet-interactive {
  cursor: crosshair;
}

.btn.secondary.on {
  border-color: var(--accent);
  background: var(--soft);
}

.draw-bar {
  flex-wrap: wrap;
  max-width: min(360px, calc(100vw - 80px));
}

.draw-bar .btns {
  display: inline-flex;
  gap: 6px;
}

.map-banner button:disabled {
  opacity: 0.45;
  cursor: default;
  background: rgba(255, 255, 255, 0.16);
}

.shape-handle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: move;
}

.shape-handle::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}

.shape-handle:hover::after,
.leaflet-drag-target .shape-handle::after {
  transform: scale(1.35);
}

.shape-handle.pulse::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: handle-pulse 1.6s ease-out 3;
  opacity: 0;
}

@keyframes handle-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .shape-handle.pulse::before { animation: none; }
}
