/* ===== T-force 工事マップ ===== */
.koji-map-section { margin: 0 0 56px; }
.koji-map-head { margin-bottom: 18px; }
.koji-map-desc { margin: 0; font-size: 13px; color: #7d7169; }

/* --- 検索UI --- */
.koji-filter-toggle { display: none; }
.koji-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.koji-search {
  flex: 1 1 220px; min-width: 200px;
  padding: 9px 16px; font-size: 13px;
  border: 1px solid #d8d2c9; border-radius: 999px; background: #fff;
}
.koji-route {
  padding: 9px 14px; font-size: 13px;
  border: 1px solid #d8d2c9; border-radius: 999px; background: #fff;
}
.koji-status { display: flex; gap: 4px; }
.koji-status button {
  padding: 9px 16px; font-size: 13px; cursor: pointer;
  border: 1px solid #d8d2c9; border-radius: 999px; background: #fff; color: inherit;
  transition: background .2s, color .2s, border-color .2s;
}
.koji-status button.is-active { background: var(--main, #591719); border-color: var(--main, #591719); color: #fff; }
.koji-count { font-size: 12px; color: #7d7169; }

/* --- 地図 --- */
.koji-map-wrap { position: relative; z-index: 0; isolation: isolate; }
.koji-map { height: 480px; border: 1px solid #d8d2c9; z-index: 1; }
.koji-legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  display: flex; gap: 14px; padding: 6px 12px; font-size: 12px;
  background: rgba(255,255,255,.92); border-radius: 6px;
}
.koji-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.koji-dot--active { background: #D85A30; }
.koji-dot--done { background: #1D9E75; }

/* --- ピン・クラスター --- */
.koji-pin { background: none; border: none; }
.koji-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.koji-cluster {
  background: rgba(89,23,25,.92); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* --- 吹き出し --- */
.koji-popup { width: 230px; }
.koji-popup img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 8px; }
.koji-popup-title { font-size: 13px; font-weight: 600; margin: 0 0 4px; line-height: 1.5; }
.koji-popup-meta { font-size: 11px; color: #7d7169; margin: 0 0 8px; }
.koji-popup-foot { display: flex; justify-content: space-between; align-items: center; }
.koji-badge { font-size: 10px; padding: 2px 10px; border-radius: 999px; }
.koji-badge--active { background: #FAECE7; color: #993C1D; }
.koji-badge--done { background: #E1F5EE; color: #085041; }
.koji-popup-link { font-size: 12px; color: var(--main, #591719); text-decoration: none; }
.koji-popup-link:hover { text-decoration: underline; }

/* --- スマホ --- */
@media (max-width: 640px) {
  .koji-map { height: 62svh; }
  /* 絞り込みはPCと同様に常時表示 */
  .koji-search { min-width: 100%; }
  /* タップした工事は吹き出しではなく中央の大型カードで表示 */
  .leaflet-popup { display: none !important; }
  .koji-sp-card {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(86%, 340px);
    aspect-ratio: 1 / 1.05; /* ほぼ正方形 */
    z-index: 650;
    display: flex; flex-direction: column; gap: 8px;
    background: #fff; border: 1px solid #d8d2c9; border-radius: 12px; padding: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
  }
  .koji-sp-card[hidden] { display: none; }
  .koji-sp-card img {
    width: 100%; flex: 1 1 auto; min-height: 0;
    object-fit: cover; border-radius: 8px;
  }
  .koji-sp-card .koji-popup-title { margin: 0; font-size: 13px; }
  .koji-sp-card .koji-popup-meta { margin: 0; }
  .koji-sp-card .koji-popup-foot { margin-top: 2px; }
  .koji-sp-card a { font-size: 12px; color: var(--main, #591719); white-space: nowrap; text-decoration: none; }
  .koji-sp-close {
    position: absolute; top: -12px; right: -12px;
    width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
    background: #591719; color: #fff; font-size: 14px; line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
  }
}
