/* ===== SPARKEARTH 追加機能（spark_tools.js）用 ===== */

/* 標高表示（赤いポインターの右上について動く） */
.elev-cursor-label { pointer-events: none; }
.elev-cursor-label span {
  display: inline-block; white-space: nowrap;
  background: rgba(255, 255, 255, 0.92); color: #222;
  padding: 2px 6px; font-size: 12px; font-weight: bold;
  border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ドットプロット：サイドバー */
.dot-plot-section h3 { margin: 4px 0; }
.dot-switch { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 4px 0; }
.dot-colors { display: flex; gap: 6px; margin: 6px 0; }
.dot-color {
  width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #999; cursor: pointer;
}
.dot-color.selected { box-shadow: 0 0 0 2px #333; }
.dot-info { display: flex; justify-content: space-between; font-size: 12px; color: #555; margin: 4px 0; }
.dot-plot-section button#dotClearAll,
.dot-plot-section button#dotImportLocal { width: 100%; margin-top: 4px; }

/* ドット配置中：カーソルを十字に */
.leaflet-container.dot-plot-mode,
.leaflet-container.dot-plot-mode .leaflet-interactive { cursor: crosshair; }
.leaflet-container.dot-plot-mode .leaflet-marker-icon,
.leaflet-container.dot-plot-mode path.leaflet-interactive[fill-opacity="0.95"] { cursor: pointer; }

.dot-mode-badge {
  display: none;
  position: absolute;
  top: 46px; left: 50%; transform: translateX(-50%);
  z-index: 960;
  background: rgba(229, 57, 53, 0.92); color: #fff;
  padding: 4px 6px 4px 10px; border-radius: 14px;
  font-size: 12px; font-weight: bold; white-space: nowrap;
}
.dot-mode-badge.active { display: block; }
/* スマホは🔗ボタンの下に表示 */
@media (max-width: 700px) {
  .dot-mode-badge { top: 84px; font-size: 11px; }
}
.dot-mode-badge button {
  margin-left: 6px; border: none; background: rgba(255,255,255,0.25); color: #fff;
  border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 20px; padding: 0;
}

/* ドットのポップアップ */
.dot-popup { font-size: 13px; }
.dot-popup-title { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.dot-popup-memo { margin-bottom: 6px; white-space: normal; word-break: break-word; }
.dot-popup-meta { color: #666; font-size: 11px; margin: 4px 0; }
.dot-popup-input, .dot-popup-textarea {
  width: 100%; box-sizing: border-box; margin-bottom: 4px;
  font-size: 13px; padding: 4px; border: 1px solid #ccc; border-radius: 4px;
}
.dot-popup-textarea { resize: vertical; }
.dot-popup-actions { display: flex; gap: 6px; justify-content: flex-end; }
.dot-popup-actions button { padding: 3px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; }
.dot-popup-actions button.primary { background: #1e88e5; border-color: #1e88e5; color: #fff; }
.dot-popup-actions button.danger { color: #e53935; }

/* 検索候補 */
.search-suggestions { max-height: 240px !important; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.search-suggestions .search-item {
  display: flex; flex-direction: column; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid #eee;
}
.search-suggestions .search-item:last-child { border-bottom: none; }
.search-suggestions .search-item:hover,
.search-suggestions .search-item.active { background: #e3f2fd; }
.search-suggestions .search-label { font-size: 13px; color: #222; }
.search-suggestions .search-sub { font-size: 11px; color: #777; }
.search-suggestions .search-empty { padding: 6px 8px; font-size: 12px; color: #777; }

/* URL共有 */
.share-section { margin: 4px 0; }
.share-section #shareUrlBtn { width: 100%; }
.share-dialog { max-width: 400px; }
.share-url-row { display: flex; gap: 6px; }
.share-url-row #shareUrlField { flex: 1; min-width: 0; box-sizing: border-box; font-size: 12px; padding: 4px 6px; }
.share-url-row #shareCopyBtn { flex-shrink: 0; white-space: nowrap; background: #1e88e5; border: 1px solid #1e88e5; color: #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.share-msg { font-size: 12px; color: #2e7d32; min-height: 18px; margin-top: 2px; }
.share-msg.error { color: #c62828; }
.share-qr-box { text-align: center; margin: 6px 0 10px; }
.share-qr-box canvas { display: block; margin: 0 auto; width: 220px; height: auto; aspect-ratio: 1; max-width: 100%; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.share-qr-msg { font-size: 12px; color: #555; min-height: 18px; margin-top: 4px; }
.share-qr-note { font-size: 11px; color: #777; }
.share-skip-note { font-size: 12px; color: #e65100; }
.share-skip-note:empty { display: none; }
.share-qr-long { display: none; font-size: 12px; color: #e65100; margin-bottom: 4px; }
.share-modal.qr-long .share-qr-long { display: block; }
.share-modal.qr-long .share-qr-box canvas { width: min(360px, 100%); }
.share-modal.qr-none .share-qr-box canvas { display: none; }
.share-modal.qr-none .share-qr-msg { color: #e65100; }
.share-modal.qr-none .share-qr-note { display: none; }
.share-choice-list { margin: 0 0 8px; padding-left: 20px; font-weight: bold; word-break: break-all; }
.share-choice-login { font-size: 12px; color: #c62828; margin-bottom: 8px; }
.share-choice-login:empty { display: none; }
.share-recv-warn { font-size: 12px; color: #c62828; margin: 0 0 10px; }
.share-choice-actions { flex-wrap: wrap; }
.share-choice-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 画像・PDF保存 */
.export-buttons { display: flex; gap: 6px; }
.export-buttons button { flex: 1; }
.export-msg { font-size: 12px; color: #555; margin-top: 4px; }
.export-modal {
  display: none; position: fixed; inset: 0; z-index: 1000000001; /* チュートリアル（driver.js）の暗幕より上 */
  background: rgba(0, 0, 0, 0.45); align-items: center; justify-content: center; padding: 16px;
}
.export-modal.open { display: flex; }
.driver-active .export-modal, .driver-active .export-modal * { pointer-events: auto; }
.export-dialog {
  background: #fff; border-radius: 8px; max-width: 480px; width: 100%;
  max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px 18px; font-size: 13px; line-height: 1.6;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.export-dialog h3 { margin: 0 0 8px; font-size: 16px; }
.export-dialog ol { margin: 0 0 10px; padding-left: 20px; }
.export-dialog ol li { margin-bottom: 4px; }
.export-lead { margin: 0 0 8px; color: #444; }
.export-credit-box { background: #f5f5f5; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.export-credit-head { font-weight: bold; font-size: 12px; color: #555; }
.export-credit-box pre { white-space: pre-wrap; word-break: break-all; font-family: inherit; font-size: 12px; margin: 4px 0; }

/* 緯度経度グリッドの目盛り */
.grid-label {
  background: rgba(255, 255, 255, 0.8); color: #c62828;
  font: bold 11px sans-serif; padding: 1px 3px; border-radius: 2px;
  white-space: nowrap; width: auto !important; height: auto !important; pointer-events: none;
}

/* 検索ピンを消す表示 */
.search-pin-chip {
  display: none; position: absolute; top: 82px; left: 50%; transform: translateX(-50%);
  z-index: 960; background: rgba(255, 255, 255, 0.95); color: #222;
  padding: 3px 4px 3px 10px; border-radius: 14px; font-size: 12px; font-weight: bold;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); white-space: nowrap; max-width: 80%;
}
.search-pin-chip.active { display: flex; align-items: center; gap: 4px; }
.search-pin-chip .search-pin-name { overflow: hidden; text-overflow: ellipsis; }
.search-pin-chip button {
  border: none; background: #eee; border-radius: 50%; width: 20px; height: 20px;
  line-height: 20px; padding: 0; cursor: pointer; flex: none;
}
.search-pin-chip button:hover { background: #ddd; }

/* 地図選択・オーバーレイ選択の折りたたみ（map_picker_groups.js） */
.picker-group-header { cursor: pointer; gap: 6px; user-select: none; }
.picker-group-header:hover { background: #f3f6fa; }
.picker-group-header .picker-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-group-header .picker-group-count {
  flex: none; font-size: 11px; font-weight: normal; color: #666;
  background: #eef1f4; border-radius: 9px; padding: 0 6px; line-height: 18px;
}
.picker-group-header .picker-expand-btn {
  flex: none; width: 24px; height: 24px; padding: 0; border: 1px solid #ccc; border-radius: 4px;
  background: #fff; color: #444; font-size: 13px; line-height: 22px; cursor: pointer;
}
.picker-group-header .picker-expand-btn:hover { background: #e3f2fd; border-color: #90caf9; }
.picker-group-header.picker-sub { padding-left: 20px; font-weight: 600; font-size: 0.95em; }
.picker-group-header.picker-empty { color: #999; }
.custom-dropdown .custom-item { padding-left: 14px; }

.overlay-picker { position: relative; margin: 2px 0 6px; }
.overlay-picker-display {
  width: 100%; display: flex; align-items: center; gap: 6px; text-align: left;
  background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 4px 6px; cursor: pointer; font: inherit; color: #222;
}
.overlay-picker-display .display { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay-picker-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 1100;
  background: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  max-height: 300px; overflow-y: auto; padding: 4px; color: #222; font-size: 13px;
}
.overlay-picker-dropdown .group-header {
  font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #eee; display: flex; align-items: center;
}
.overlay-picker-dropdown .custom-item { padding: 4px 6px 4px 14px; cursor: pointer; }
.overlay-picker-dropdown .custom-item:hover { background: #f6f6f6; }
.overlay-picker-dropdown .custom-item.selected { background: #e3f2fd; font-weight: bold; }

/* 未ログイン時の保存案内 */
.dot-login-link { display: block; font-size: 12px; margin: 2px 0 6px; color: #1565c0; }
