/* =========================================================
   リードマップ Webアプリ 追加スタイル
   （現行サイトの assets/site.css に追加で読み込む分。
     既存デザインの変数・雰囲気に合わせている）
   ========================================================= */

/* ---------- アプリバー ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
  position: sticky; top: 0; z-index: 1200;
}
.appbar-brand { font-weight: 900; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.appbar-nav { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.appbar-nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 8px 10px;
  border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.appbar-nav a:not(.appbar-cta):not(.appbar-user):hover { background: var(--surface); color: var(--ink); }
.appbar-nav a.appbar-cta {
  background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 15px;
  box-shadow: 0 4px 12px rgba(253, 101, 0, 0.22);
}
.appbar-nav a.appbar-cta:hover { background: var(--brand-strong); }
.appbar-nav a.appbar-user {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px 3px 4px;
}
.appbar-user-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: none; }
.appbar-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 700; }

/* スマホでは上部メニューを詰め込みすぎない（マイページは右上のチップから開けるため重複リンクを隠す） */
@media (max-width: 640px) {
  .appbar { padding: 8px 12px; gap: 8px; }
  .appbar-brand { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .appbar-nav { gap: 10px; font-size: 13px; flex-shrink: 0; }
  .appbar-nav a.appbar-cta { padding: 6px 11px; }
  .appbar-nav a[href="mypage.html"]:not(.appbar-user) { display: none; }
  .appbar-user-name { max-width: 64px; }
  .appbar-user-img { width: 24px; height: 24px; }
}

/* ---------- 認証ページ ---------- */
.auth-wrap { max-width: 480px; margin: 0 auto; padding: 40px 16px 64px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 28px 24px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; margin: 0 0 10px; }
.auth-lead { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; margin: 0 0 20px; }
.auth-label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.auth-input {
  width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); color: var(--ink);
  margin: 0 0 16px; transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-input:focus {
  border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 18%, transparent);
}
.auth-input-code { letter-spacing: 6px; font-size: 22px; text-align: center; font-weight: 700; }
.auth-btn { width: 100%; justify-content: center; }
.auth-msg { min-height: 1.4em; font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }
.auth-msg-error { color: #c62828; font-weight: 700; }
.auth-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; margin: 16px 0 0; }
.auth-demo {
  border: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--brand-soft); color: var(--ink);
  border-radius: var(--r-m); padding: 12px 14px; font-size: 13.5px; line-height: 1.7; margin: 0 0 18px;
}
.auth-sub { margin: 22px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.auth-back { background: none; border: none; color: var(--ink-2); font-size: 14px; cursor: pointer; text-decoration: underline; padding: 12px 8px; margin: 8px 0 0; width: 100%; min-height: 44px; }

/* ---------- マイページ ---------- */
.mypage-wrap { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
.mypage-head { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; }
.mypage-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.mypage-avatar-ph {
  width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--ink-3);
  border: 1px solid var(--line);
}
.mypage-name { font-size: 20px; font-weight: 900; margin: 0; }
.mypage-email { color: var(--ink-2); font-size: 14px; margin: 2px 0 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 22px 22px; margin: 0 0 18px;
}
.panel h2 { font-size: 18px; margin: 0 0 12px; }
.panel p { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.status-badge {
  display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px;
  padding: 4px 12px; background: var(--surface-2); color: var(--ink-2);
}
.status-badge.on { background: var(--brand); color: #fff; }
.panel .btn { margin: 6px 8px 0 0; }
.profile-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-preview { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.file-label { display: inline-block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px; }
.panel input[type="file"] { padding: 8px 0; font-size: 14px; max-width: 100%; }
#buyMapAction .btn { margin: 0 8px 10px 0; }
.buy-card .btn-block { width: 100%; }
.logout-btn { color: #c62828; }

/* ---------- 購入ページ ---------- */
.buy-wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 64px; }
.buy-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .buy-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.buy-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px 22px;
}
.buy-card h3 { margin: 0 0 6px; font-size: 18px; }
.buy-price { font-size: 30px; font-weight: 900; margin: 6px 0; }
.buy-price small { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.buy-card ul { margin: 10px 0 18px; padding-left: 1.2em; color: var(--ink-2); font-size: 14.5px; line-height: 1.8; }
.buy-note { font-size: 13px; color: var(--ink-3); line-height: 1.7; margin: 14px 0 0; }

/* ---------- 購入ページ：リスト作成の決済前フォーム ---------- */
.order-plans { border: none; margin: 0 0 2px; padding: 0; }
.plan-option {
  display: block; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin: 0 0 10px; cursor: pointer; background: var(--bg);
  transition: border-color .15s ease, background .15s ease;
}
.plan-option:hover { border-color: var(--ink-3); }
.plan-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.plan-option input { margin: 0 8px 0 0; width: 18px; height: 18px; accent-color: var(--brand); vertical-align: -3px; }
.plan-option-head b { font-size: 16px; }
.plan-option-price { font-weight: 900; margin-left: 10px; }
.plan-option-desc { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; margin: 4px 0 0 24px; }
.field-error { color: #c62828; font-size: 13.5px; font-weight: 700; margin: -8px 0 14px; }
.field-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; margin: -4px 0 16px; }
.auth-input.input-error { border-color: #c62828; }
.confirm-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14.5px; }
.confirm-table th, .confirm-table td {
  border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top;
  overflow-wrap: anywhere;
}
.confirm-table th { background: var(--surface); width: 34%; white-space: nowrap; }

/* ---------- マップ本体 ---------- */
.map-page { display: flex; flex-direction: column; min-height: calc(100vh - 49px); }
.map-head { padding: 12px 14px 4px; }
.map-user { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.map-user-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.map-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; align-items: center; }
.map-controls select {
  font-size: 16px; padding: 10px 32px 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background-color: var(--bg); color: var(--ink); max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%2371717a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.map-controls select:focus {
  border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 18%, transparent);
}
@media (max-width: 640px) {
  .map-controls select { flex: 1 1 26%; min-width: 0; }
}
.map-count { font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.plan-banner {
  margin: 0 14px 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent);
  font-size: 14px; line-height: 1.6;
}
.plan-banner a { font-weight: 700; }
#mapEl { height: 46vh; min-height: 300px; width: 100%; }
.map-msg { padding: 8px 14px 0; font-size: 14px; color: var(--ink-2); min-height: 1.2em; }
.map-lower { padding: 6px 14px 28px; }
.lead-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lead-empty, .detail-empty { color: var(--ink-3); font-size: 14px; padding: 10px 2px; }
.lead-more { margin: 14px 0 0; width: 100%; }
.lm-divicon { background: none; border: none; }

/* ---------- Leaflet標準コントロールをアプリの見た目に合わせる ---------- */
.leaflet-container { font-family: inherit; }
#mapEl .leaflet-bar, #sampleMap .leaflet-bar {
  border: none; border-radius: var(--r-m); overflow: hidden;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.14), 0 10px 24px rgba(16, 24, 40, 0.14);
}
#mapEl .leaflet-bar a, #sampleMap .leaflet-bar a {
  width: 36px; height: 36px; line-height: 36px; border: none;
  background: var(--bg); color: var(--ink-2);
}
#mapEl .leaflet-bar a:hover, #sampleMap .leaflet-bar a:hover { background: var(--surface); color: var(--ink); }
#mapEl .leaflet-bar a:first-child, #sampleMap .leaflet-bar a:first-child { border-bottom: 1px solid var(--line); }
#mapEl .leaflet-control-attribution, #sampleMap .leaflet-control-attribution {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--ink-3); font-size: 10px; padding: 1px 6px;
}
#mapEl .leaflet-control-attribution a, #sampleMap .leaflet-control-attribution a { color: var(--ink-3); }
.map-detail { margin: 16px 0 0; }
.tel-link { background: none; border: none; padding: 6px 2px; font: inherit; color: var(--appo, #2563eb); text-decoration: underline; cursor: pointer; }
.tel-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tel-confirm[hidden] { display: none; }
.tel-confirm .tel-call { text-decoration: none; }
.fav-btn {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  width: 44px; height: 44px; font-size: 21px; line-height: 1; color: var(--ink-3);
  cursor: pointer; flex: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .12s ease;
}
.fav-btn:active { transform: scale(.94); }
.fav-btn.fav-on { color: #e0245e; border-color: #e0245e; }
.fav-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 14px 0; }
.fav-row[hidden] { display: none; }
.fav-label { font-size: 12px; color: var(--ink-2); }
.fav-chip-on { border-color: #e0245e; color: #e0245e; }

/* ---------- ピンのポップアップ（確認用の軽量表示） ---------- */
.lead-popup .leaflet-popup-content-wrapper {
  background: var(--bg); color: var(--ink); border-radius: var(--r-l);
  box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.lead-popup .leaflet-popup-content {
  margin: 13px 30px 13px 15px; font-size: 13px; line-height: 1.55;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}
.lead-popup .leaflet-popup-tip { background: var(--bg); border: none; box-shadow: none; }
.lead-popup .leaflet-popup-close-button {
  width: 30px; height: 30px; font-size: 15px; line-height: 30px; text-align: center;
  top: 5px; right: 5px; border-radius: 50%;
  color: var(--ink-3) !important; padding: 0; z-index: 10;
  transition: background .15s ease, color .15s ease;
}
.lead-popup .leaflet-popup-close-button:hover { background: var(--surface); color: var(--ink) !important; }
.pop-name { font-weight: 900; font-size: 14px; margin: 0 0 3px; overflow-wrap: anywhere; letter-spacing: 0.01em; }
/* 一覧・ピンと共通の番号バッジ（色はピンのステータス色＝CSS変数が正） */
.num-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; width: auto; height: 24px; border-radius: 50%; flex: none;
  padding: 0 2px; box-sizing: border-box; white-space: nowrap;
  color: #fff; font-size: 12.5px; font-weight: 900; line-height: 1;
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.28);
  margin-right: 7px; vertical-align: -6px;
}
.num-badge.dn2 { font-size: 11.5px; }
.num-badge.dn3 { font-size: 10.5px; border-radius: 999px; padding: 0 5px; }
.num-badge.dn4 { font-size: 10px; border-radius: 999px; padding: 0 5px; }
.num-badge.st-visited { background: var(--ok); }
.num-badge.st-appo { background: var(--appo); }
.num-badge.st-revisit { background: var(--revisit); }
.num-badge.st-ng { background: var(--ng); }
.detail-card h3 .num-badge { min-width: 26px; height: 26px; font-size: 13px; vertical-align: -7px; }
.detail-card h3 .num-badge.dn2 { font-size: 12px; }
.detail-card h3 .num-badge.dn3 { font-size: 11px; }
.detail-card h3 .num-badge.dn4 { font-size: 10.5px; }
.pop-row { margin: 0 0 1px; color: var(--ink-2); overflow-wrap: anywhere; }
.pop-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* ---------- 画面一番上の選択中バー ---------- */
.sel-bar {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin: 12px 16px 0; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease;
}
.sel-bar:active { transform: scale(.99); box-shadow: var(--shadow); }
.sel-bar[hidden] { display: none; }
.sel-bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sel-bar-name { font-weight: 900; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-bar-sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-bar-go { font-size: 12px; font-weight: 700; color: var(--brand-strong); flex: none; }
