/**
 * 地価情報マップ - スタイルシート
 */

/* ===== リセット・ベース ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo,
    sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== ヘッダー ===== */
#header {
  background-color: #2c3e50;
  color: white;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#header h1 {
  font-size: 18px;
  font-weight: bold;
  white-space: nowrap;
}

/* ===== 検索エリア（外部リンク + 検索コンテナ） ===== */
#search-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== 検索コンテナ ===== */
#search-container {
  display: flex;
  gap: 8px;
}

#search-input {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  width: 300px;
}

#search-input:focus {
  outline: 2px solid #3498db;
}

#search-button {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#search-button:hover {
  background-color: #2980b9;
}

#search-button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

/* ===== 外部リンクボタン ===== */
#external-links {
  display: flex;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.external-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 13px;
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s, transform 0.1s;
  white-space: nowrap;
}

.external-link-btn .btn-icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.external-link-btn .btn-text {
  font-weight: 500;
}

.external-link-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}

.external-link-btn:active {
  transform: scale(0.98);
}

/* ===== 情報ボタン ===== */
#settings-button {
  background: none;
  border: none;
  font-size: 22px;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: auto;
  opacity: 0.9;
  transition: opacity 0.2s;
}

#settings-button:hover {
  opacity: 1;
}

/* ===== 地図コンテナ ===== */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ===== 地図 ===== */
#map {
  height: 100%;
  width: 100%;
  position: relative;
}

/* ===== 地図中心クロスヘア ===== */
#map-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  pointer-events: none;
  opacity: 0.8;
}

/* ===== 検索結果候補一覧 ===== */
#search-results {
  display: none;
  position: fixed;
  top: 56px;
  right: 20px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1100;
  min-width: 350px;
  max-width: 500px;
}

#search-results.show {
  display: block;
}

#search-results.hover-hidden {
  visibility: hidden;
}

.result-header {
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: bold;
  font-size: 13px;
  color: #495057;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6c757d;
  padding: 0 5px;
}

.result-close:hover {
  color: #343a40;
}

.result-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.result-item:hover {
  background-color: #e3f2fd;
}

.result-item:last-child {
  border-bottom: none;
}

.result-source {
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
}

.no-results {
  padding: 15px;
  text-align: center;
  color: #6c757d;
}

/* ===== 設定モーダル ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #343a40;
}

.modal-body {
  padding: 20px;
}

/* ===== 使用量表示 ===== */
.usage-section {
  margin-bottom: 20px;
}

.usage-section h3 {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 12px;
}

.usage-stats {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 16px;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.usage-row:last-child {
  margin-bottom: 0;
}

.usage-label {
  color: #495057;
}

.usage-value {
  font-weight: bold;
  color: #2c3e50;
}

.usage-value.warning {
  color: #e67e22;
}

.usage-value.danger {
  color: #e74c3c;
}

/* ===== 使用量バー ===== */
.usage-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: #3498db;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.usage-bar-fill.warning {
  background: #e67e22;
}

.usage-bar-fill.danger {
  background: #e74c3c;
}

/* ===== 累計表示 ===== */
.usage-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #dee2e6;
}

/* ===== 使用量の説明 ===== */
.usage-note {
  font-size: 12px;
  color: #6c757d;
  margin-top: 12px;
  text-align: center;
}

.usage-limit-info {
  margin-top: 16px;
  padding: 12px;
  background: #fff3cd;
  border-radius: 6px;
  font-size: 13px;
  color: #856404;
}

.usage-limit-info p {
  margin: 0;
}

.usage-limit-info p + p {
  margin-top: 6px;
}

.marker-hint {
  display: block;
  margin-top: 4px;
  color: #888;
  font-size: 11px;
}

/* ===== 地価情報コントロールパネル ===== */
.land-price-control {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
  font-size: 13px;
}

.land-price-control-header {
  background: #2c3e50;
  color: white;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  font-size: 13px;
}

.land-price-control-body {
  padding: 12px 14px;
}

.land-price-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 13px;
}

.land-price-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.land-price-checkbox input[type="checkbox"]:checked + .checkbox-icon {
  border-color: transparent;
}

.land-price-checkbox input[type="checkbox"]:checked + .koji-icon {
  background: #e74c3c;
}

.land-price-checkbox input[type="checkbox"]:checked + .chosa-icon {
  background: #3498db;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
}

.koji-icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.land-price-checkbox input[type="checkbox"]:checked + .koji-icon::after {
  background: white;
}

.land-price-search-btn {
  width: 100%;
  padding: 10px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.land-price-search-btn:hover:not(:disabled) {
  background: #2980b9;
}

.land-price-search-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.land-price-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: #7f8c8d;
  font-size: 12px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.land-price-count {
  text-align: center;
  margin-top: 10px;
  color: #27ae60;
  font-size: 12px;
  font-weight: 500;
}

.land-price-warning {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  color: #856404;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  text-align: center;
}

/* ===== 共通マップピンマーカー（SVGベース） ===== */

.land-price-marker,
.saved-location-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.land-price-marker .marker-icon,
.saved-location-marker .marker-icon {
  width: 24px;
  height: 34px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.land-price-marker .marker-icon svg,
.saved-location-marker .marker-icon svg {
  width: 100%;
  height: 100%;
}

/* 検索/クリック時の緑ピンマーカー */
.search-pin-marker {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  background: none !important;
  border: none !important;
}

/* マーカーラベル（フォントサイズ拡大） */
.marker-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 6px;
  border-radius: 3px;
  margin-top: 4px;
  font-weight: 600;
  color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 検索範囲の矩形 */
.search-bounds-rectangle {
  stroke: #4a90c4;
  stroke-width: 2.5;
  stroke-dasharray: 8, 4;
  fill: rgba(74, 144, 196, 0.05);
  stroke-opacity: 0.85;
}

/* ===== 地価情報モーダル ===== */
.modal-land-price {
  max-width: 550px;
  max-height: 85vh;
}

.land-price-section {
  margin-bottom: 20px;
}

.land-price-section:last-child {
  margin-bottom: 0;
}

.land-price-section h3 {
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #3498db;
}

.land-price-section h4 {
  font-size: 13px;
  color: #495057;
  margin: 16px 0 10px;
}

.land-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.land-price-table th,
.land-price-table td {
  padding: 8px 10px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.land-price-table th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 500;
  width: 40%;
}

.land-price-table td {
  color: #2c3e50;
}

.history-table th,
.history-table td {
  text-align: center;
}

.history-table th:first-child,
.history-table td:first-child {
  width: 25%;
}

/* 価格ハイライト */
.price-highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 12px;
}

.price-label {
  display: block;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.price-value {
  font-size: 28px;
  font-weight: bold;
}

.price-unit {
  font-size: 14px;
  opacity: 0.9;
}

.change-rate {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.change-label {
  color: #6c757d;
}

.change-value {
  font-weight: bold;
}

.change-value.positive {
  color: #e74c3c;
}

.change-value.negative {
  color: #3498db;
}

.change-value.zero {
  color: #6c757d;
}

/* グラフコンテナ */
.chart-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

#lp-price-chart {
  max-height: 200px;
}

/* 価格履歴ローディング */
.history-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: #666;
  font-size: 14px;
}

.loading-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 容積率の注記 */
.ratio-note {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff8e1;
  border-left: 3px solid #ffc107;
  font-size: 12px;
  color: #666;
}

/* 鑑定評価書リンク */
.appraisal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
}

.appraisal-link:hover {
  background: #5a6fd6;
  color: white;
}

.appraisal-icon {
  width: 16px;
  height: 16px;
}

/* 地価コントロール モバイル対応は統合メディアクエリで定義 */

/* ===== フローティングパネル ===== */
.floating-panel {
  display: none;
  position: fixed;
  top: 80px;
  right: 20px;
  width: 420px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 1500;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  min-width: 320px;
  min-height: 200px;
}

.floating-panel.show {
  display: flex;
}

.floating-panel.minimized {
  max-height: 300px;
  height: auto !important;
  resize: none;
  min-height: auto;
}

.floating-panel.minimized .floating-panel-body {
  display: block;
  padding: 12px;
  max-height: 250px;
  overflow-y: auto;
}

/* 最小化時に非表示にするセクション */
.floating-panel.minimized .section-hideable {
  display: none !important;
}

/* 最小化時に表示する価格推移セクション */
.floating-panel.minimized .section-price-history {
  display: block;
  margin-bottom: 0;
}

.floating-panel.minimized .section-price-history h3 {
  font-size: 12px;
  margin-bottom: 8px;
}

.floating-panel.dragging {
  opacity: 0.9;
  cursor: grabbing;
  user-select: none;
}

.floating-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.floating-panel-header:active {
  cursor: grabbing;
}

.floating-panel-header h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 8px;
}

.floating-panel-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.panel-minimize,
.panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.panel-minimize:hover,
.panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.panel-close:hover {
  background: rgba(231, 76, 60, 0.8);
}

.floating-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* フローティングパネル内のセクション */
.floating-panel .land-price-section {
  margin-bottom: 16px;
}

.floating-panel .land-price-section:last-child {
  margin-bottom: 0;
}

.floating-panel .land-price-section h3 {
  font-size: 13px;
  color: #2c3e50;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #667eea;
}

.floating-panel .land-price-table {
  font-size: 12px;
}

.floating-panel .land-price-table th,
.floating-panel .land-price-table td {
  padding: 6px 8px;
}

.floating-panel .price-highlight {
  padding: 12px;
  margin-bottom: 10px;
}

.floating-panel .price-value {
  font-size: 24px;
}

/* フローティングパネル モバイル対応は統合メディアクエリで定義 */

/* ===== 登録地点パネル ===== */
.saved-location-panel {
  position: absolute;
  top: 240px;
  right: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
  max-width: 250px;
  font-size: 13px;
  overflow: hidden;
}

.saved-location-panel-header {
  background: #27ae60;
  color: white;
  padding: 10px 14px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.saved-location-panel-header:hover {
  background: #219a52;
}

.panel-toggle-icon {
  transition: transform 0.2s;
}

.saved-location-panel.collapsed .panel-toggle-icon {
  transform: rotate(-90deg);
}

.saved-location-panel-body {
  max-height: 300px;
  overflow-y: auto;
}

.saved-location-panel.collapsed .saved-location-panel-body {
  display: none;
}

.saved-location-list {
  padding: 0;
}

.saved-location-empty {
  padding: 16px;
  text-align: center;
  color: #95a5a6;
  font-size: 12px;
}

.saved-location-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  gap: 10px;
}

.saved-location-item:last-child {
  border-bottom: none;
}

.saved-location-item:hover {
  background: #f8f9fa;
}

.saved-location-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.saved-location-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.saved-location-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-location-detail {
  font-size: 11px;
  color: #7f8c8d;
  margin-top: 2px;
}

.saved-location-delete {
  background: none;
  border: none;
  color: #bdc3c7;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.saved-location-delete:hover {
  color: #e74c3c;
  background: #fdeaea;
}

/* ===== 登録地点マーカー（共通ピンスタイルを継承） ===== */
/* .saved-location-marker の基本スタイルは共通セクションで定義済み */

.saved-location-marker .marker-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 13px;
  white-space: nowrap;
  margin-top: 4px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 登録地点ポップアップ */
.saved-location-popup {
  min-width: 150px;
}

.saved-location-popup .popup-header {
  padding-left: 8px;
  margin-bottom: 8px;
}

.saved-location-popup .popup-info {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.saved-location-popup .popup-price {
  font-weight: bold;
  color: #2c3e50;
}

.saved-location-popup .popup-memo {
  font-size: 11px;
  color: #7f8c8d;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 8px;
}

.saved-location-popup .popup-actions {
  display: flex;
  gap: 8px;
}

.saved-location-popup .popup-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: #3498db;
  color: white;
}

.saved-location-popup .popup-btn:hover {
  background: #2980b9;
}

.saved-location-popup .popup-btn-danger {
  background: #e74c3c;
}

.saved-location-popup .popup-btn-danger:hover {
  background: #c0392b;
}

.saved-location-popup .popup-btn-primary {
  background: #27ae60;
  flex: 1 1 100%;
}

.saved-location-popup .popup-btn-primary:hover {
  background: #219a52;
}

/* 詳細表示ボタンと編集/削除ボタンの間に余白 */
.saved-location-popup .popup-actions + .popup-actions {
  margin-top: 8px;
}

/* ===== 地点登録ダイアログ ===== */
.dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.dialog-overlay.show {
  display: flex;
}

.dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 360px;
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #27ae60;
  color: white;
}

.dialog-header h3 {
  margin: 0;
  font-size: 16px;
}

.dialog-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
}

.dialog-close:hover {
  opacity: 1;
}

.dialog-body {
  padding: 20px;
}

.dialog-footer {
  padding: 16px 20px;
  background: #f8f9fa;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

/* カラーピッカー */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: #2c3e50;
}

/* ボタン */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: #27ae60;
  color: white;
}

.btn-primary:hover {
  background: #219a52;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* 地価パネルの登録ボタン */
.panel-register-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  cursor: pointer;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.9;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.panel-register-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.35);
}

/* 検索マーカーポップアップの登録ボタン */
.search-popup-actions {
  margin-top: 8px;
}

.search-popup-register-btn {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #27ae60;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.search-popup-register-btn:hover {
  background: #219a52;
}

/* 登録地点パネル モバイル対応は統合メディアクエリで定義 */

/* ===== トースト通知 ===== */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   モバイルレスポンシブ対応（統合メディアクエリ）
   ============================================================ */
@media (max-width: 768px) {
  /* --- ヘッダー --- */
  #header {
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }

  #header-left {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  #header h1 {
    font-size: 15px;
  }

  #settings-button {
    margin-left: auto;
    font-size: 24px;
    padding: 4px 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- 検索エリア --- */
  #search-area {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  #external-links {
    padding-right: 0;
    border-right: none;
    justify-content: center;
    gap: 6px;
  }

  .external-link-btn {
    font-size: 11px;
    padding: 6px 8px;
    min-height: 36px;
    gap: 4px;
  }

  .external-link-btn .btn-icon-svg {
    width: 16px;
    height: 16px;
  }

  #search-container {
    width: 100%;
    gap: 6px;
  }

  #search-input {
    flex: 1;
    width: auto;
    min-width: 0;
    font-size: 16px; /* iOS ズーム防止 */
  }

  #search-button {
    min-width: 56px;
    min-height: 44px;
  }

  /* --- 検索結果ドロップダウン --- */
  #search-results {
    top: auto;
    right: 8px;
    left: 8px;
    min-width: auto;
    max-width: none;
    max-height: 50vh;
  }

  /* --- 地価情報コントロールパネル --- */
  .land-price-control {
    top: 10px;
    right: 10px;
    left: auto;
    bottom: auto;
    min-width: auto;
    max-width: 200px;
  }

  .land-price-control-header {
    padding: 8px 12px;
    font-size: 12px;
  }

  .land-price-control-body {
    padding: 8px 12px;
  }

  .land-price-checkbox {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .land-price-search-btn {
    padding: 8px;
    font-size: 12px;
  }

  /* --- 登録地点パネル --- */
  .saved-location-panel {
    top: auto;
    bottom: 40px;
    right: 10px;
    left: auto;
    min-width: auto;
    max-width: 200px;
  }

  .saved-location-panel-header {
    padding: 8px 12px;
    font-size: 12px;
  }

  .saved-location-panel-body {
    max-height: 200px;
  }

  .saved-location-item {
    padding: 8px 10px;
  }

  .saved-location-name {
    font-size: 12px;
  }

  .saved-location-detail {
    font-size: 10px;
  }

  /* --- フローティングパネル（地価詳細） --- */
  .floating-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    resize: none;
    min-width: auto;
  }

  .floating-panel.minimized {
    max-height: none;
  }

  .floating-panel.minimized .floating-panel-body {
    display: none;
  }

  .floating-panel-header {
    padding: 10px 14px;
    border-radius: 16px 16px 0 0;
  }

  .floating-panel-header h2 {
    font-size: 13px;
  }

  /* --- 地価モーダル --- */
  .modal-land-price {
    max-height: 90vh;
  }

  .price-value {
    font-size: 24px;
  }

  /* --- ダイアログ --- */
  .dialog {
    width: 95%;
    max-width: none;
  }

  /* --- 地価警告トースト --- */
  .land-price-warning {
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
  }

  /* --- トースト通知 --- */
  .toast-notification {
    left: 16px;
    right: 16px;
    transform: translateY(20px);
    text-align: center;
  }

  .toast-notification.show {
    transform: translateY(0);
  }
}
