/* えどがわ こどもマップ：地図が主役の1画面。上にタイトルと絞り込み、右下に大きなボタン、下から一覧やお知らせが出る。
 * このページはポータルの共通ヘッダー・フッター・base.css を使わず、単独で完結させている（2026-11-14）。 */
:root {
  /* サイトのテーマ色（assets/base.css）。タイトルのアイコン・メニューや一覧の背景・文字・枠線をこれに合わせている */
  --accent: #2563eb;      /* シビックブルー */
  --accent-bg: #dbeafe;
  --tint: #eef4ff;        /* 薄い面（注意書き・hover） */
  --ink: #0d1e42;         /* 文字・枠線・影 */
  --ink-soft: #2d4a7a;
  --paper: #ffffff;       /* ボタン・シート・吹き出しの背景 */
  --line: #c0d4f0;
  --park: #1d4ed8;
  --child: #1d4ed8;
  --danger: #E5484D;
  --fun: #FFD23F;
  --fac: #1d4ed8;
  --library: #1d4ed8;
  --shadow: 0 6px 24px rgba(13, 30, 66, .18);
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", sans-serif;
  --body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.6 var(--body); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--ink); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

#map { position: absolute; inset: 0; background: #eef2f9; }
.nogl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--ink-soft); line-height: 1.9; }

/* 上部：タイトルと絞り込み */
.top { position: absolute; z-index: 1000; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0; pointer-events: none; display: flex; flex-direction: column; gap: 10px; }
.brand { pointer-events: auto; align-self: flex-start; display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 999px; padding: 6px 16px 6px 6px; box-shadow: var(--shadow); border: 0; text-align: left; }
.brand .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 900 15px var(--round); }
.brandwrap { margin: 0; font: inherit; pointer-events: none; align-self: flex-start; }
.brand .ttl { display: block; font: 900 18px/1.1 var(--round); letter-spacing: .02em; }
.brand small { display: block; font: 500 11px var(--round); color: var(--ink-soft); letter-spacing: .04em; }
.chips { pointer-events: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 5px 14px; font: 700 14px var(--round); display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 0 var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .sw { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.chip[aria-pressed="true"] .sw { border-color: var(--paper); }
.chip .sw.park { background: var(--park); }
.chip .sw.child { background: var(--child); }
.chip .sw.library { background: var(--library); }
.me { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(26, 115, 232, .4); }
.chip .caret { font-size: 10px; margin-left: 2px; }
.facmenu { pointer-events: auto; align-self: flex-start; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 8px 8px; display: flex; flex-direction: column; min-width: 250px; max-width: calc(100vw - 32px); }
.fopt { display: flex; align-items: center; gap: 10px; padding: 8px 6px; font: 700 14px var(--round); cursor: pointer; }
.fopt input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.fopt .ft { flex: 1; }
.fopt .fn { font: 700 12px var(--body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.fhint { margin: 0; padding: 2px 6px 6px; font-size: 12px; color: var(--ink-soft); }
.fclear { align-self: flex-end; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 3px 12px; font: 700 12px var(--round); }
.chip .n { font: 700 12px var(--body); opacity: .75; font-variant-numeric: tabular-nums; }

/* 右下・左下のボタン */
.fabs { position: absolute; z-index: 1000; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 44px); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { border: 2px solid var(--ink); background: var(--accent); color: #fff; border-radius: 999px; padding: 14px 22px; font: 900 17px var(--round); box-shadow: 0 4px 0 var(--ink); display: flex; align-items: center; gap: 8px; }
.fab:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.mini { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 8px 14px; font: 700 13px var(--round); box-shadow: 0 2px 0 var(--ink); }
.lefts { position: absolute; z-index: 1000; left: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 44px); }
.scenebtn { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 10px 18px; font: 700 14px var(--round); box-shadow: 0 2px 0 var(--ink); }

/* いちばん下の細い帯：出典・非公式の表示（地図の出典表示を兼ねる） */
.credit { position: absolute; z-index: 999; left: 0; right: 0; bottom: 0; padding: 4px 12px calc(env(safe-area-inset-bottom, 0px) + 4px); background: rgba(255, 255, 255, .92); font: 11px/1.5 var(--body); color: var(--ink-soft); display: flex; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
.credit a { color: var(--ink-soft); }
.credit button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; }

/* 下から出るシート（一覧・このマップについて） */
.scrim { position: absolute; z-index: 1100; inset: 0; background: rgba(13, 30, 66, .35); }
.sheet { position: absolute; z-index: 1200; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--paper); border: 2px solid var(--ink); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow); max-height: 78%; display: flex; flex-direction: column; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 4px; flex: none; }
.sheet .shead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 16px 8px; flex: none; }
.sheet h2 { margin: 0; font: 900 18px/1.3 var(--round); }
.sheet .body { overflow-y: auto; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.sheet .x { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 4px 12px; font: 700 13px var(--round); box-shadow: 0 2px 0 var(--ink); }
.search { display: flex; gap: 8px; padding: 0 16px 10px; flex: none; }
.search input { flex: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; font: 16px var(--body); background: #fff; color: var(--ink); }
.search button { border: 2px solid var(--ink); background: var(--accent); color: #fff; border-radius: 999px; padding: 6px 16px; font: 900 14px var(--round); box-shadow: 0 2px 0 var(--ink); }
.listnote { margin: 0; padding: 0 16px 6px; font-size: 12px; color: var(--ink-soft); flex: none; }
.rlist { list-style: none; margin: 0; padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 12px); overflow-y: auto; }
.rlist li { border-top: 1px solid var(--line); }
.ritem { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 16px; }
.ritem:hover { background: var(--tint); }
.ritem b { display: block; font: 700 15px/1.4 var(--round); }
.ritem small { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.badge { display: inline-block; font: 700 11px var(--round); padding: 1px 9px; border-radius: 999px; border: 1.5px solid var(--ink); color: var(--ink); }
.badge.park { background: var(--park); color: #fff; }
.badge.child { background: var(--child); color: #fff; }
.badge.library { background: var(--library); color: #fff; }

/* お知らせ・本文 */
.about p { margin: 0 0 10px; }
.about h3 { font: 900 15px var(--round); margin: 18px 0 4px; }
.about ul { margin: 0 0 10px; padding-left: 1.3em; }
.about .note { background: var(--accent-bg); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
.km-fold { margin: 6px 0; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.km-fold summary { cursor: pointer; padding: 8px 12px; font: 700 14px var(--round); }
.km-list { margin: 0; padding: 0 12px 10px 2em; font-size: 13px; line-height: 1.7; }
.km-note { font-size: 13px; color: var(--ink-soft); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 8px 18px; font: 700 14px var(--round); box-shadow: 0 2px 0 var(--ink); text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); color: #fff; }

.toast { position: absolute; z-index: 1300; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); max-width: calc(100% - 32px); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 18px; font: 700 13px var(--round); box-shadow: var(--shadow); }
.loading { position: absolute; z-index: 1000; left: 50%; transform: translateX(-50%); top: 50%; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 18px; font: 700 13px var(--round); box-shadow: 0 2px 0 var(--ink); }

/* 地図の吹き出し（MapLibre の既定を上書き） */
.maplibregl-popup-content { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; font-family: var(--body); color: var(--ink); }
.maplibregl-popup-close-button { font-size: 20px; padding: 2px 8px; color: var(--ink); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--ink); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--ink); }
.pop { max-width: 250px; font-size: 13px; line-height: 1.6; }
.pop h4 { margin: 6px 0 4px; font: 900 16px/1.4 var(--round); }
.pop p { margin: 0 0 4px; }
.pop .links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.pop .links a { font-weight: 700; }
.pop .fnote { margin-top: 8px; font-size: 11px; color: var(--ink-soft); }

@media (min-width: 700px) {
  .sheet { left: 16px; right: auto; margin: 0; bottom: 44px; border-bottom: 2px solid var(--ink); border-radius: 20px; width: 400px; max-height: calc(100% - 190px); }
  .sheet.about { left: 50%; transform: translateX(-50%); width: 560px; max-height: calc(100% - 80px); bottom: 40px; }
}
@media (max-width: 420px) {
  .brand .ttl { font-size: 16px; }
  .chip { padding: 5px 11px; font-size: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
  @media (min-width: 700px) { .sheet.about { animation: none; } }
}
.legend i.park { background: var(--park); }
.legend i.child { background: var(--child); }
.legend i.library { background: var(--library); }

/* ---- 書きこみ（Phase 2、2026-11-14） ---- */
.agesel { pointer-events: auto; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 5px 12px; font: 700 13px var(--round); box-shadow: 0 2px 0 var(--ink); color: var(--ink); }
.chip .sw.danger { background: var(--danger); }
.chip .sw.fun { background: var(--fun); }
.chip .sw.facility { background: var(--fac); }
.legend i.danger, .legend i.fun, .legend i.facility { width: 22px; height: 22px; display: inline-grid; place-items: center; font: 900 12px var(--round); color: #fff; }
.legend i.danger { background: var(--danger); }
.legend i.fun { background: var(--fun); color: var(--ink); }
.legend i.facility { background: var(--fac); }
.legend i.dot { width: 12px; height: 12px; border-width: 1.5px; }
.legend i.dot.facility { background: var(--fac); }
.badge.danger { background: var(--danger); color: #fff; }
.badge.fun { background: var(--fun); }
.badge.facility { background: var(--fac); color: #fff; }
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px 8px; flex: none; }
.listbar .listnote { padding: 0; }

/* 場所選び */
.pickpanel { position: absolute; z-index: 1001; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); max-width: 520px; margin: 0 auto; background: var(--ink); color: var(--paper); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.pickpanel button { white-space: nowrap; background: var(--paper); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; font: 700 13px var(--round); }
.pickpanel .ok { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff; }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 700 15px var(--round); }
.por, .pact { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; flex-wrap: wrap; }
.draftpin { display: block; cursor: grab; filter: drop-shadow(0 2px 0 rgba(13, 30, 66, .35)); }
body.picking #map canvas { cursor: crosshair; }

/* フォーム */
.sheet.form { z-index: 1250; max-height: 88%; }
.field { margin: 0 0 14px; }
.field > label, .field .lbl { display: block; font: 700 14px var(--round); margin-bottom: 6px; }
.opt { font: 400 12px var(--body); color: var(--ink-soft); }
.field input[type=text], .field textarea { width: 100%; border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; font: 16px/1.5 var(--body); background: #fff; color: var(--ink); }
.field textarea { min-height: 88px; resize: vertical; }
.count { display: block; text-align: right; font-size: 12px; color: var(--ink-soft); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button, .tags button { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 14px; font: 700 14px var(--round); box-shadow: 0 2px 0 var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags button { font-size: 13px; padding: 5px 12px; }
.seg button[aria-pressed="true"], .tags button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg .sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.seg .sw.danger { background: var(--danger); } .seg .sw.fun { background: var(--fun); } .seg .sw.facility { background: var(--fac); }
.seg button[aria-pressed="true"] .sw { border-color: var(--paper); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formnote { background: var(--accent-bg); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.formnote ul { margin: 6px 0; padding-left: 1.3em; }
.formnote p { margin: 6px 0 0; }
.err { color: var(--danger); font: 700 14px var(--round); min-height: 1.2em; margin: 10px 0 0; }
.btn[disabled] { opacity: .6; }

/* 吹き出し（書きこみ） */
.pop .tag { font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.pop .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.pop .fac { background: var(--tint); border-radius: 10px; padding: 6px 10px; margin: 4px 0 6px; font-size: 12px; }
.pop .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--ink-soft); margin: 4px 0; }
.pop .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.pop .like { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 4px 12px; font: 700 13px var(--round); box-shadow: 0 2px 0 var(--ink); }
.pop .like[aria-pressed="true"] { background: var(--accent); color: #fff; }
.pop .report, .pop .ask { background: none; border: 0; padding: 2px 0; font: 12px var(--body); color: var(--ink-soft); text-decoration: underline; }
.pop .mine { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; gap: 8px; align-items: center; font: 700 12px var(--round); }
.pop .mine button { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 2px 10px; font: 700 12px var(--round); }
.pop .mine .del { color: var(--danger); border-color: var(--danger); }
.pop .askbox { margin-top: 6px; font-size: 12px; background: var(--tint); border-radius: 8px; padding: 6px 8px; }

/* 利用規約ページ（/kodomo-map/terms/）。地図ページ用の body の固定（overflow:hidden）を外す */
body.docpage { overflow: auto; height: auto; padding: 0 16px; }
.doc { max-width: 680px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 24px) 0 calc(env(safe-area-inset-bottom, 0px) + 48px); font: 16px/1.85 var(--body); }
.doc h1 { font: 900 26px/1.35 var(--round); margin: 24px 0 4px; }
.doc .meta { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }
.doc .lead { background: var(--tint); border-radius: 14px; padding: 14px 16px; }
.doc .toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.doc .toc a { border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px; font: 700 13px var(--round); text-decoration: none; background: #fff; color: var(--ink); }
.doc h2 { font: 900 21px/1.4 var(--round); margin: 40px 0 8px; padding-top: 12px; border-top: 3px solid var(--accent); }
.doc h3 { font: 700 16px/1.5 var(--round); margin: 24px 0 4px; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 1.3em; }
.doc .ng li::marker { content: "× "; color: var(--danger); font-weight: 700; }
.doc .tbl { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 12px; }
.doc th, .doc td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.doc th { font: 700 13px var(--round); color: var(--ink-soft); white-space: nowrap; }
body.picking .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); }   /* 場所選びの案内に重ならないようにする */
