/* ============================================================
   モトダチ マイマップ (sites/mymap/)
   デザイン方針: 白背景・清潔感。地図が主役、数字は控えめ。
   ブランドイエロー #FFD600 はアクセントのみ。角丸は angular(8/12)。
   トークンは公式LP styles.css と同値でブランド一貫性を保つ。
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #FFFFFF;
  --paper-2: #FAFAF8;          /* 地図キャンバスの微暖色オフホワイト */
  --ink: #1A1A1A;
  --ink-2: #555;
  --ink-3: #8A8A8A;
  --line: #E7E7E4;
  --line-strong: #D6D6D2;

  --yellow: #FFD600;
  --yellow-dark: #C8A400;
  --green: #059669;           /* 地方制覇(Complete) */

  /* 塗り3状態 */
  --fill-gps: #FFD600;         /* 走行実績 */
  --fill-manual: #FCE795;      /* 手動チェック(淡い黄) */
  --fill-none: #E6E6E2;        /* 未走破 */
  --fill-stroke: #FFFFFF;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 100px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 8px 24px rgba(0,0,0,0.04);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 数字は Inter tabular で桁を揃える */
.mm-stat-value,
.mm-region-count,
.mm-detail-count { font-family: 'Inter', 'Noto Sans JP', sans-serif; font-variant-numeric: tabular-nums; }

/* ---- view 切り替え ---- */
/* 中央寄せ系(login/loading/notlinked/error)は grid、全画面系(map/detail)は block。
   トグルルールの特異性(0,3,0)が .mm-login 等(0,1,0)を上書きするため、
   display値をここで確定させる(place-items が block に潰されないように)。 */
.mm [data-when] { display: none; }
.mm[data-view="loading"]   [data-when="loading"],
.mm[data-view="login"]     [data-when="login"],
.mm[data-view="notlinked"] [data-when="notlinked"],
.mm[data-view="error"]     [data-when="error"] { display: grid; }
.mm[data-view="map"]       [data-when="map"],
.mm[data-view="detail"]    [data-when="detail"] { display: block; }

/* 未ログイン(anon)/ログイン済み(user) の出し分け */
.mm[data-auth="anon"] [data-user-only] { display: none; }
.mm[data-auth="user"] [data-anon-only] { display: none; }

/* ============ Loading ============ */
.mm-loading { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.mm-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--yellow);
  animation: mm-spin 0.8s linear infinite;
}
@keyframes mm-spin { to { transform: rotate(360deg); } }

/* ============ Brand ============ */
.mm-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mm-logo svg { display: block; width: 32px; height: 32px; }
.mm-brand-text { font-weight: 900; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.mm-brand--lg { flex-direction: column; gap: 14px; }
.mm-brand--lg .mm-logo svg { width: 52px; height: 52px; }
.mm-brand--lg .mm-brand-text { font-size: 15px; color: var(--ink-3); font-weight: 700; letter-spacing: 0.02em; }

/* ============ Login / Not-linked / Error card ============ */
.mm-login, .mm-notlinked, .mm-error {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,214,0,0.06), transparent 60%),
    var(--paper);
}
.mm-login-card {
  width: 100%; max-width: 380px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 32px;
  box-shadow: var(--shadow-card);
}
.mm-login-title { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; margin-top: 2px; }
.mm-login-lead { color: var(--ink-2); font-size: 15px; line-height: 1.8; margin-top: -8px; }

.mm-login-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; margin-top: 4px; }
/* Google公式(GIS)ボタンの描画枠。GISは固定幅なので中央寄せ */
.mm-gbtn { display: flex; justify-content: center; min-height: 44px; width: 100%; }
.mm-gbtn > div { color-scheme: light; }
.mm-oauth {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 20px;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.1s var(--ease);
}
.mm-cta .mm-oauth { max-width: 300px; }
.mm-oauth:hover { border-color: var(--ink); background: var(--paper-2); }
.mm-oauth:active { transform: translateY(1px); }
.mm-oauth-icon { flex: none; }
.mm-oauth[data-provider="apple"] .mm-oauth-icon { color: var(--ink); }

.mm-login-note { font-size: 13px; color: var(--ink-3); line-height: 1.8; margin-top: 2px; }
.mm-login-note a { color: var(--yellow-dark); font-weight: 700; text-decoration: none; }
.mm-login-note a:hover { text-decoration: underline; }

.mm-notlinked-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,214,0,0.12); color: var(--yellow-dark);
  transform: rotate(0);
}
.mm-notlinked-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.mm-notlinked-lead { color: var(--ink-2); font-size: 14.5px; line-height: 1.85; }
.mm-notlinked-lead strong { color: var(--ink); }

/* ============ Buttons ============ */
.mm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 15px; white-space: nowrap;
  padding: 12px 24px; border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: all 0.2s var(--ease);
}
.mm-btn--primary { background: var(--yellow); color: var(--ink); }
.mm-btn--primary:hover { background: var(--yellow-dark); }
.mm-btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.mm-btn--ghost:hover { color: var(--ink); border-color: var(--ink); }
.mm-btn--sm { padding: 8px 14px; font-size: 13px; }
.mm-login-card .mm-btn { width: 100%; }

/* ============ App shell (header + main) ============ */
.mm-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 20px;
  background: rgba(255,255,255,0.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.mm-header-right { display: flex; align-items: center; gap: 12px; }
.mm-userbox { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.mm-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; background: var(--paper-2); }
.mm-avatar--default { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); border: 1px solid var(--line); }
/* hidden属性を効かせる(display指定を上書きするため) */
.mm-avatar[hidden] { display: none; }
.mm-user { font-size: 14px; font-weight: 600; color: var(--ink-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  padding: 8px 6px; margin-left: -6px; border-radius: var(--radius);
}
.mm-back:hover { color: var(--yellow-dark); }
.mm-back svg { flex: none; }

.mm-main { max-width: 940px; margin: 0 auto; padding: 28px 20px 64px; }

/* ============ CTA(サンプル→ログイン導線) ============ */
.mm-cta {
  background: rgba(255, 214, 0, 0.07);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 20px 16px;
  margin-bottom: 22px;
  text-align: center;
}
.mm-cta-text { font-size: 14.5px; color: var(--ink); line-height: 1.75; font-weight: 500; margin-bottom: 14px; }
.mm-cta-text strong { color: var(--yellow-dark); font-weight: 700; }
.mm-cta-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mm-cta-note { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
/* アプリ内WebView時(mymap.js が .mm に data-webview 付与): OAuthボタンを隠し外部ブラウザ誘導へ */
.mm-cta-webview { display: none; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.mm-cta-webview-note { font-size: 13px; line-height: 1.7; color: var(--ink-3); text-align: center; margin: 0; }
.mm[data-webview] .mm-cta-actions,
.mm[data-webview] .mm-cta-note { display: none; }
.mm[data-webview] .mm-cta-webview { display: flex; }
.mm-cta--flash { animation: mm-cta-flash 0.9s ease-out; }
@keyframes mm-cta-flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 214, 0, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(255, 214, 0, 0); }
}

/* ============ Stats band ============ */
.mm-stats {
  display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap;
  padding-bottom: 18px;
}
.mm-stat { display: flex; flex-direction: column; gap: 2px; }
.mm-stat-value { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.mm-stat--primary .mm-stat-value { font-size: 44px; font-weight: 900; }
.mm-stat-sep { color: var(--line-strong); margin: 0 4px; font-weight: 700; }
.mm-stat-total { color: var(--ink-3); }
.mm-stat-unit { font-size: 0.55em; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.mm-stat-label { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.04em; }
.mm-stat--primary .mm-stat-label { color: var(--ink-2); }

/* progress meter */
.mm-meter { width: 100%; height: 6px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; flex-basis: 100%; }
.mm-meter--sm { height: 5px; }
.mm-meter-fill { height: 100%; background: var(--yellow); border-radius: inherit; transition: width 0.8s var(--ease); }

/* ============ Map ============ */
.mm-mapwrap { margin-top: 8px; position: relative; }
.mm-zoom-reset {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink-2); cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mm-zoom-reset:hover { color: var(--ink); border-color: var(--ink); }
.mm-map {
  width: 100%; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 12px;
  /* iOSのタップ時の黒いハイライト枠と、ドラッグ中のテキスト選択を無効化 */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none; -webkit-user-select: none;
}
/* touch-action:none で地図がタッチジェスチャ(1本指パン/2本指ピンチ)を完全に受け取る。
   pan-y だとピンチ中にページ縦スクロールが競合するため。ページのスクロールは地図外で行う。 */
.mm-map svg { display: block; width: 100%; height: auto; overflow: hidden; touch-action: none; cursor: grab; }
.mm-map svg:active { cursor: grabbing; }
.mm-map-hint { text-align: center; font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }
.mm-map-loading { display: grid; place-items: center; min-height: 220px; }

/* prefecture / municipality paths */
.mm-pref, .mm-muni {
  stroke: var(--fill-stroke); stroke-width: 0.75px; vector-effect: non-scaling-stroke;
  fill: var(--fill-none);
  transition: fill 0.25s var(--ease);
}
.mm-pref.is-gps,  .mm-muni.is-gps    { fill: var(--fill-gps); }
.mm-pref.is-manual { fill: var(--fill-manual); }
.mm-pref.is-none,  .mm-muni.is-none  { fill: var(--fill-none); }
/* outline: none で 県クリック時のブラウザ既定フォーカス枠(青/黒の丸枠)を出さない。
   キーボード操作時は下の :focus-visible の濃い境界線でフォーカスを示す。 */
.mm-pref { cursor: pointer; outline: none; }
.mm-pref:focus { outline: none; }
.mm-pref:hover, .mm-pref:focus-visible {
  stroke: var(--ink); stroke-width: 1.4px; outline: none;
}

/* 沖縄インセット枠 */
.mm-inset { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.mm-inset-label { fill: var(--ink-3); font-family: 'Noto Sans JP', sans-serif; font-weight: 700; font-size: 15px; }

/* 都道府県名ラベル(白ハロー付き・ズームでフォントは画面上一定)。
   halo は non-scaling-stroke を使わずフォントに比例した stroke-width をJSで設定する
   (non-scaling-stroke はパン時の再描画で黒縁が出るブラウザ描画バグがあるため回避)。 */
.mm-plabel {
  fill: var(--ink); stroke: #fff; paint-order: stroke;
  font-family: 'Noto Sans JP', sans-serif; font-weight: 700;
  pointer-events: none; user-select: none;
}

/* signature: 塗られていく微アニメ(初回描画) */
.mm-map--animate .mm-pref { animation: mm-fill-in 0.5s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes mm-fill-in { from { opacity: 0; } to { opacity: 1; } }

/* ============ Legend ============ */
.mm-legend { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 18px; }
.mm-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.mm-sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.06); flex: none; }
.mm-sw--gps { background: var(--fill-gps); }
.mm-sw--manual { background: var(--fill-manual); }
.mm-sw--none { background: var(--fill-none); }

/* ============ 市区町村チップ一覧(詳細ビュー) ============ */
.mm-muni-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.mm-muni-chip {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2);
  cursor: pointer; transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.mm-muni-chip.is-visited { background: rgba(255, 214, 0, 0.16); border-color: var(--yellow); color: var(--ink); }
.mm-muni-chip:hover { border-color: var(--ink); }
.mm-muni-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.mm-muni { cursor: pointer; }
.mm-muni:hover { stroke: var(--ink); stroke-width: 1px; }
.mm-muni.is-selected { stroke: var(--ink); stroke-width: 2.2px; }

/* ============ Regional breakdown ============ */
.mm-regions {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 32px;
}
.mm-region { display: grid; grid-template-columns: 4.5em 1fr auto; align-items: center; gap: 12px; }
.mm-region-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mm-region-bar { height: 6px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.mm-region-bar-fill { display: block; height: 100%; background: var(--yellow); border-radius: inherit; transition: width 0.8s var(--ease); }
.mm-region-count { font-size: 12.5px; font-weight: 700; color: var(--ink-3); min-width: 3.2em; text-align: right; white-space: nowrap; }
.mm-region-check { vertical-align: -1.5px; margin-right: 3px; }
.mm-region.is-complete .mm-region-bar-fill { background: var(--green); }
.mm-region.is-complete .mm-region-count { color: var(--green); }

/* ============ Detail head ============ */
.mm-detail-head { margin-bottom: 16px; }
.mm-detail-title { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.mm-detail-count { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 4px 0 12px; }
.mm-detail-count b { color: var(--yellow-dark); font-size: 1.05em; }

/* ============ Toast ============ */
.mm-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: var(--radius); z-index: 9999;
  opacity: 0; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  pointer-events: none; box-sizing: border-box; white-space: normal;
  text-align: center; line-height: 1.5;
  width: max-content; max-width: min(420px, calc(100vw - 24px));
}
.mm-toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.mm-toast.is-error { background: #DC2626; }

/* ============ AdSense PC サイドレール（3段階レスポンシブ） ============ */
/* 中央940pxカラムの外側(左右余白)に固定。map/detail 以外(login/loading/error)では出さない。
   ≥1620px=300×600 ／ 1340〜1619px=160×600 ／ <1340px はインコンテンツ枠。
   各レールは 300用/160用の <ins> を持ち、画面幅で表示を出し分ける(同一slotを共用)。 */
.mm-adrail { display: none; position: fixed; top: 76px; z-index: 15; }
.mm-adrail-ins { display: none; height: 600px; }
.mm-adrail-ins--160 { width: 160px; }
.mm-adrail-ins--300 { width: 300px; }

/* 標準ノートPC(1340〜1619px): 160×600 */
@media (min-width: 1340px) and (max-width: 1619.98px) and (min-height: 680px) {
  .mm[data-view="map"] .mm-adrail,
  .mm[data-view="detail"] .mm-adrail { display: block; width: 160px; }
  .mm-adrail-ins--160 { display: block; }
  .mm-adrail--left  { left:  calc((100vw - 940px) / 2 - 176px); }
  .mm-adrail--right { right: calc((100vw - 940px) / 2 - 176px); }
}
/* ワイドPC(≥1620px): 300×600 */
@media (min-width: 1620px) and (min-height: 680px) {
  .mm[data-view="map"] .mm-adrail,
  .mm[data-view="detail"] .mm-adrail { display: block; width: 300px; }
  .mm-adrail-ins--300 { display: block; }
  .mm-adrail--left  { left:  calc((100vw - 940px) / 2 - 320px); }
  .mm-adrail--right { right: calc((100vw - 940px) / 2 - 320px); }
}

/* モバイル/タブレット用インコンテンツ広告。PC(≥1340px)は左右レールを使うため隠す */
.mm-ad-inline { margin: 28px 0 4px; text-align: center; }
.mm-ad-label { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
@media (min-width: 1340px) { .mm-ad-inline { display: none; } }

/* ============ シェアボタン（統計バンド/詳細ヘッダーの右上・地図の近く） ============ */
.mm-share-btn { gap: 6px; }
.mm-share-btn svg { flex: none; }
.mm-stats .mm-share-btn { margin-left: auto; align-self: flex-end; }
.mm-detail-head { position: relative; }
.mm-detail-head .mm-share-btn { position: absolute; top: 0; right: 0; }

/* ============ CTA: アプリ導入バッジ + 区切り ============ */
.mm-cta-install { margin: 2px 0 4px; }
.mm-cta-install-label { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.mm-store-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mm-store-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff; text-decoration: none;
  padding: 9px 16px; border-radius: 10px;
  transition: opacity 0.2s var(--ease), transform 0.1s var(--ease);
}
.mm-store-badge:hover { opacity: 0.9; }
.mm-store-badge:active { transform: translateY(1px); }
.mm-store-badge svg { flex: none; }
.mm-store-badge-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.mm-store-badge-text small { font-size: 9px; opacity: 0.8; font-weight: 500; }
.mm-store-badge-text b { font-size: 15px; font-weight: 700; }
.mm-cta-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--ink-3); font-size: 12px; }
.mm-cta-divider::before, .mm-cta-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============ 共有フォールバックモーダル ============ */
.mm-share-modal {
  position: fixed; inset: 0; z-index: 9998; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.mm-share-modal.is-open { display: flex; }
.mm-share-card {
  position: relative; width: 100%; max-width: 440px;
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 26px 24px; box-shadow: var(--shadow-card); text-align: center;
}
.mm-share-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px;
}
.mm-share-x:hover { color: var(--ink); background: var(--paper-2); }
.mm-share-title { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.mm-share-preview {
  width: 100%; max-width: 320px; aspect-ratio: 1 / 1; object-fit: contain;
  border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2);
  margin: 0 auto 16px; display: block;
}
.mm-share-native {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-bottom: 12px; padding: 14px;
  border: none; border-radius: var(--radius);
  background: var(--yellow); color: var(--ink);
  font-family: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.mm-share-native:hover { background: var(--yellow-dark); }
.mm-share-native svg { flex: none; }
.mm-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mm-share-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.mm-share-act:hover { border-color: var(--ink); }
.mm-share-act--x { background: #000; color: #fff; border-color: #000; }
.mm-share-act--line { background: #06C755; color: #fff; border-color: #06C755; }
.mm-share-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 12px; line-height: 1.6; }

/* ============ Responsive ============ */
@media (min-width: 700px) {
  .mm-main { padding: 40px 24px 80px; }
  .mm-map { padding: 20px; }
}
@media (max-width: 700px) {
  /* モバイルは地図を画面内に収め、地図の外(下のチップ/上の見出し)でスクロールできるように */
  .mm-map svg { max-height: 64vh; }
}
@media (max-width: 560px) {
  .mm-stats { gap: 20px; }
  .mm-stat--primary .mm-stat-value { font-size: 38px; }
  .mm-stat-value { font-size: 22px; }
  .mm-regions { grid-template-columns: 1fr; gap: 10px; }
  .mm-user { max-width: 110px; }
}
/* 狭い画面はヘッダーの表示名を省いて溢れを防ぐ(地図が主役) */
@media (max-width: 460px) {
  .mm-user { display: none; }
  .mm-share-label { display: none; }
  .mm-header { padding: 0 16px; }
  .mm-main { padding-left: 16px; padding-right: 16px; }
}

/* ============ a11y ============ */
:focus-visible { outline: 2px solid var(--yellow-dark); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .mm-spinner { animation-duration: 0.8s !important; }
}
