/* まちの間取り［プロ版］の共通部品。
   色・文字・区画は暮らしモード（../css/kurashi.css）をそのまま使い、
   ここにはプロ版にしか無いもの（グラフ・順位の目盛り・表・印刷）だけを置く。
   画面ごとの見え方は analyze.css / showing.css に分ける。 */

:root { --data: #0B8060; }

.brand-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: #fff; background: var(--accent-ink);
  border-radius: 4px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px;
}

/* ───────── グラフ（自前のSVG。凡例と注記は文字で出す） */

.ch { display: flex; flex-direction: column; gap: 8px; }
.ch-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-hit:hover line { opacity: .35 !important; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }
.ch-key { display: inline-flex; align-items: center; gap: 6px; }
.ch-key b { font-weight: 700; color: var(--ink); }
.ch-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.ch-note { font-size: 11px; color: var(--muted); line-height: 1.6; }
.ch-empty {
  font-size: 12px; color: var(--muted); padding: 16px;
  background: var(--placeholder-soft); border-radius: 8px; text-align: center;
}
.ch-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; }
.ch-seg { min-width: 2px; }

/* 横棒の一覧（施設の件数・距離別の地価） */
.rb { display: grid; grid-template-columns: 8em minmax(0, 1fr) 6.2em; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.rb-label { color: var(--muted); }
.rb-track { background: var(--placeholder-soft); border-radius: 4px; height: 10px; }
.rb-fill { height: 10px; border-radius: 4px; }
.rb-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 23区の駅の中での位置 */
.rankbar { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.rankbar .track { position: relative; height: 6px; background: var(--placeholder-soft); border-radius: 3px; }
.rankbar .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line-strong); }
.rankbar .dot {
  position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 999px; background: var(--data); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--data);
}
.rankbar .ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* 表。数字が主役なので桁を揃える */
.raw-table td.n, .raw-table th.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.raw-table td.src { font-size: 10px; color: var(--muted); }
.raw-table td.act { vertical-align: middle; }

/* 折りたたみ（計算方法・注意） */
details.fold { border-top: 1px solid var(--line-soft); padding-top: 8px; }
details.fold > summary {
  cursor: pointer; font-size: 13px; color: var(--accent); list-style: none;
  min-height: 44px; display: flex; align-items: center;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '＋ '; }
details.fold[open] > summary::before { content: '− '; }
details.fold > div { padding-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }

.caution {
  font-size: 12px; background: #F6ECE4; color: #8A4B22;
  padding: 10px 12px; border-radius: 8px; line-height: 1.7;
}

/* 信頼度と層の印 */
.badge-conf {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap;
}
.badge-conf[data-level="低"] { background: #F6ECE4; color: #8A4B22; }
.badge-conf[data-level="中"] { background: #F1EFE8; color: var(--muted); }

/* 出典の一行（グラフの下） */
.src-line { font-size: 10px; color: var(--muted); }

/* 一時的な知らせ */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: var(--surface); font-size: 13px; padding: 10px 16px;
  border-radius: 999px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); max-width: 90vw; text-align: center;
}

/* ───────── 01 ホーム */

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; align-items: start; }
.home-side { border-left: 1px solid var(--line); background: var(--surface); }
.entry-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.entry {
  padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
}
.entry:hover { border-color: var(--accent); color: var(--ink); }
.entry .head { display: flex; align-items: center; gap: 10px; }
.entry .ico {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.entry .t { font-size: 15px; font-weight: 700; }
.entry .d { font-size: 12px; line-height: 1.7; color: var(--muted); }
.entry .go { font-size: 13px; font-weight: 700; color: var(--accent); }

.recent-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.recent-row .l { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recent-row .name { font-size: 14px; font-weight: 700; }
.recent-row .meta { font-size: 11px; color: var(--muted); }
.recent-row .r { display: flex; gap: 8px; flex-shrink: 0; }
.recent-row .btn { min-height: 34px; font-size: 12px; padding: 0 12px; }

.kv-rows { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.kv-row .k { color: var(--muted); min-width: 0; }
.kv-row .v { flex-shrink: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 899px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-side { border-left: 0; border-top: 8px solid var(--bg); }
  .entry-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ───────── 印刷 */

@media print {
  body { background: #fff; }
  .btn, .chip, details.fold { display: none !important; }
  .section, .tabs-wrap { break-inside: avoid; }
}

/* ───────── 分析画面の地図（地理院タイル＋重ね描き） */

.map-box {
  position: relative; overflow: hidden; border-radius: 10px;
  background: var(--placeholder); border: 1px solid var(--line);
}
.map-tiles { position: absolute; inset: 0; }
.map-tiles img { display: block; }
.map-over { position: absolute; left: 0; top: 0; }

/* 特化係数 */
.lq { display: grid; grid-template-columns: 7em minmax(0, 1fr) 6.5em; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.lq-label { color: var(--muted); }
.lq-track { position: relative; height: 12px; background: var(--placeholder-soft); border-radius: 3px; }
.lq-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.lq-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.lq-value { text-align: right; font-variant-numeric: tabular-nums; }
.lq-n { color: var(--muted); font-size: 10px; }

.spark { display: block; }

/* ───────── 切り替えボタン（分析の集計範囲・接客の歩ける範囲で共用）
   接客用ビューは analyze.css を読まないので、共通のここに置く。 */

.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1 1 0; min-height: 36px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.seg button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
}
