:root {
    --bg: #fbf8f3; --surface: #fff; --text: #3b3530; --muted: #8a8079; --border: #e9e2d8;
    --primary: #e07a3f; --primary-dark: #c4622a; --danger: #d64545; --like: #e8467c; --ok: #3a9d5d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; }
a { color: var(--primary-dark); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.inline { display: inline; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--text); white-space: nowrap; }
/* PC はロゴ・ナビ・ログアウトの横一列、スマホはロゴを左・ログアウトを右端に */
.header-top { display: contents; }
.logout { order: 1; font-size: .92rem; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--text); }
.nav a.btn { color: #fff; }
.site-footer { color: var(--muted); font-size: .8rem; padding: 32px 16px; text-align: center; }
.site-footer a { color: inherit; }

.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; font-size: 1rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b33636; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
button.link { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; }

.flash { background: #e8f6ec; border: 1px solid #bfe3c9; color: #22663a; padding: 10px 16px; border-radius: 8px; margin: 16px 0; }
.errors { background: #fdecec; border: 1px solid #f3c3c3; color: #9b2c2c; padding: 8px 16px; border-radius: 8px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 1.2em; }
.notice { background: #fff4e0; border: 1px solid #f0d49b; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; }

.hero { padding: 24px 0 8px; }
.hero h1 { margin: 0; font-size: 1.6rem; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin: 20px 0; }
.panel.narrow { max-width: 440px; margin: 40px auto; }
.panel h1 { margin-top: 0; font-size: 1.4rem; }
.panel h2 { margin-top: 0; font-size: 1.15rem; }
.narrow-form { max-width: 440px; }
.sub { font-size: .9rem; color: var(--muted); }

.map { height: 340px; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0; z-index: 0; }
.map-lg { height: 420px; }
.leaflet-tooltip.place-label { padding: 1px 8px; border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--text); font-size: .75rem; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.leaflet-tooltip.place-label::before { display: none; }
.hide-labels .place-label { display: none; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.map-wrap { position: relative; }
.map-locate { position: absolute; right: 10px; bottom: 28px; z-index: 1000; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.map-locate:hover { background: var(--bg); }
.file-pick { position: relative; align-items: center; padding: 18px 12px; border: 2px dashed var(--primary); border-radius: 12px; background: var(--bg); cursor: pointer; }
.file-pick:hover, .file-pick:focus-within { background: #fff; }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-pick-btn { background: var(--primary); color: #fff; border-radius: 999px; padding: 12px 28px; font-size: 1.05rem; }
/* 選んだ後は「選び直す」なので、白地に縁取りで控えめにする */
.file-pick-btn.is-chosen { background: #fff; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.tip { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #e9f6ee; border: 1px solid #b9e0c7; color: #1f6b3d; font-size: .9rem; font-weight: 400; line-height: 1.6; }
.tip span { font-size: .82rem; }
.search-box { margin-bottom: 8px; }
.search-box summary { cursor: pointer; font-size: .9rem; color: var(--muted); padding: 4px 0; }
.search-box[open] summary { margin-bottom: 6px; }
.place-search { display: flex; gap: 8px; margin-bottom: 8px; }
.place-search input { flex: 1; min-width: 0; }
.search-results { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.search-results[hidden] { display: none; }
.search-results li + li { border-top: 1px solid var(--border); }
.search-results li.hint { padding: 8px 12px; }
.search-results button { display: flex; flex-direction: column; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; font: inherit; cursor: pointer; }
.search-results button:hover { background: var(--bg); }
.search-results button span { font-size: .82rem; color: var(--muted); }
.photo-spot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .9rem; }
.photo-spot[hidden], .photo-spot button[hidden] { display: none; }
.area-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.area-filter select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; max-width: 100%; }
.area-filter a { font-size: .85rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.card-thumb { aspect-ratio: 4/3; background: #f2ebe1; display: flex; align-items: center; justify-content: center; position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { font-size: 2.5rem; opacity: .5; }
.card-body { padding: 12px 14px; }
.card-body h3 { margin: 0 0 4px; font-size: 1rem; }
.genre-tag { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: 999px; background: #e9f6ee; color: #1f6b3d; font-size: .75rem; }
.excerpt { margin: 0; font-size: .85rem; color: var(--muted); }
.route { margin: -4px 0 12px; text-align: right; }
.meta { display: flex; gap: 12px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.author { display: inline-flex; align-items: center; gap: 6px; }
.avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-none { display: inline-flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); font-size: .75em; }
.avatar-lg { width: 112px; height: 112px; font-size: 3.2rem; }
.avatar-edit { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cropper { display: flex; flex-direction: column; gap: 10px; }
.cropper[hidden] { display: none; }
.cropper .sub { margin: 0; font-weight: 400; }
.crop-stage { position: relative; width: min(260px, 70vw); aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #222; touch-action: none; cursor: grab; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; transform-origin: 0 0; }
.crop-stage::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.55); border: 2px solid #fff; pointer-events: none; }
.cropper input[type=range] { width: min(260px, 70vw); }
.crop-actions { display: flex; gap: 8px; }
.crop-actions[hidden], .hint[hidden] { display: none; }
#avatar-form { gap: 10px; }
#crop-actions .privacy-note { margin-top: 6px; }
.form label.file-btn { display: inline-flex; position: relative; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.rank { position: absolute; top: 8px; left: 8px; background: #fff; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.private-badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; padding: 2px 10px; border-radius: 999px; }
.rank-1 { background: #f4c542; } .rank-2 { background: #c9ced6; } .rank-3 { background: #d9a173; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 12px 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.photos.no-save img { cursor: zoom-in; }
.no-save img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.photo-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .85); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.photo-viewer[hidden] { display: none; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.photos.small { grid-template-columns: repeat(5, 1fr); }
.photo-del { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; cursor: pointer; }
.comment { white-space: normal; word-break: break-word; margin: 16px 0; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.like-btn { border: 2px solid var(--like); background: #fff; color: var(--like); border-radius: 999px; padding: 8px 20px; font-size: 1rem; cursor: pointer; }
.like-btn .heart { display: inline-block; transition: transform .2s; }
.like-btn.liked { background: var(--like); color: #fff; }
.like-btn.liked .heart { transform: scale(1.25); }
.want-btn { border: 2px solid var(--ok); background: #fff; color: var(--ok); border-radius: 999px; padding: 8px 20px; font: inherit; font-size: 1rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.want-btn.wanted { background: var(--ok); color: #fff; }

.form { display: flex; flex-direction: column; gap: 18px; }
.form label, .label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; font-weight: 400; }
.form input:not([type=checkbox]):not([type=file]), .form textarea, .inline-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; }
.form textarea { resize: vertical; }
.hint { font-weight: 400; font-size: .84rem; color: var(--muted); margin: 0; }
.privacy-note { display: block; }
.counter { text-align: right; }
em.req, em.opt { font-style: normal; font-size: .72rem; padding: 1px 6px; border-radius: 4px; margin-left: 6px; font-weight: 400; }
em.req { background: var(--danger); color: #fff; }
em.opt { background: var(--border); }

/* 管理画面 */
.admin-nav { display: flex; gap: 4px; margin-top: 20px; border-bottom: 2px solid var(--border); }
.admin-nav a, .tabs a { padding: 8px 16px; text-decoration: none; color: var(--muted); }
.admin-nav a.active { color: var(--text); border-bottom: 2px solid var(--primary); margin-bottom: -2px; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin: 12px 0; }
.tabs a { border-radius: 999px; font-size: .88rem; }
.tabs a.active { background: var(--text); color: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; margin: 2px 2px 0 0; }
.tag-ng { background: #fdecec; color: var(--danger); }
.tag-public { background: #e8f6ec; color: var(--ok); }
.tag-private { background: #eee; color: #666; }
.admin-head { display: flex; align-items: center; gap: 12px; }
.admin-head h1 { margin: 0; }
.detail { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 20px 0; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; }
.detail .comment { margin: 0; }
mark { background: #ffd8d8; color: #a10000; padding: 0 2px; border-radius: 3px; }
.inline-form { display: flex; gap: 8px; margin: 16px 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; white-space: nowrap; }
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.word button { color: var(--danger); margin-left: 4px; }

nav[role=navigation] ul, .pagination { display: flex; gap: 8px; list-style: none; padding: 0; margin: 20px 0; }
.pagination li a, .pagination li span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; text-decoration: none; }

@media (max-width: 640px) {
    .header-inner { height: auto; padding: 10px 16px; flex-direction: column; }
    .header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .nav { margin-left: 0; }
    .table thead { display: none; }
    .table td { display: block; border: 0; padding: 4px 0; }
    .table tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
    .detail { grid-template-columns: 1fr; }
    .photos.small { grid-template-columns: repeat(3, 1fr); }
}
.pagination { flex-wrap: wrap; }
.pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled span { color: var(--muted); }

.radios { display: flex; gap: 16px; margin: 6px 0 8px; }
.radios label { display: flex; align-items: center; gap: 4px; font-weight: normal; }
.radios input { width: auto; }
.radios-stack { flex-direction: column; gap: 6px; }
.radios-stack label { flex-direction: row; flex-wrap: wrap; }
.radios-stack .hint { margin-left: 4px; }
/* 投稿フォームのジャンル選択。ラジオを隠し、選んだものを塗りつぶしたチップで見せる */
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.form .genre-chips label { position: relative; flex-direction: row; align-items: center; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-weight: 400; font-size: .92rem; cursor: pointer; }
.form .genre-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; border: 0; pointer-events: none; }
.form .genre-chips label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.form .genre-chips label:has(input:focus-visible) { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fact { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: .88rem; }

/* 公園名・コメント欄 */
.place-name { margin: 0 0 4px; font-size: .9rem; color: var(--muted); }
.panel h1 + .place-name { margin-top: -8px; font-size: 1rem; }
.comments .comment-item { border-top: 1px solid var(--border); padding: 12px 0; }
.comments .comment-item .meta { margin-top: 0; align-items: center; }
.comments .comment-item p { margin: 6px 0 0; word-break: break-word; }
.comments .comment-item form { margin-left: auto; }
.comment-form { margin-top: 16px; gap: 8px; }

/* 利用規約 */
.terms h3 { font-size: 1rem; margin: 20px 0 6px; }
.terms ol { padding-left: 1.4em; margin: 0; }
.terms-box { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 14px; background: var(--bg); font-size: .85rem; font-weight: 400; }
.terms-box h3 { font-size: .9rem; margin-top: 14px; }

/* 紹介ページ */
.lp-hero { text-align: center; padding: 48px 16px 32px; }
.lp-hero h1 { margin: 12px 0 8px; font-size: 2rem; line-height: 1.4; }
.lp-hero p { margin: 0; color: var(--muted); }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.lp-section { margin: 40px 0; }
.lp-section h2 { text-align: center; font-size: 1.4rem; margin: 0 0 20px; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.lp-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.lp-feature h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.lp-feature p { margin: 0; font-size: .9rem; color: var(--muted); text-align: left; }
.lp-icon { font-size: 2.2rem; }
.lp-steps { list-style: none; counter-reset: step; margin: 0 auto; padding: 0; max-width: 640px; }
.lp-steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 12px 0; }
.lp-steps li::before { content: counter(step); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lp-steps span { font-size: .9rem; color: var(--muted); }
.lp-more { text-align: right; margin: 12px 0 0; }
.lp-safe { background: #e9f6ee; border: 1px solid #b9e0c7; border-radius: 12px; padding: 24px; }
.lp-safe ul { list-style: none; margin: 0 auto 8px; padding: 0; max-width: 640px; }
.lp-safe li { padding: 4px 0; }
.lp-safe .sub { text-align: center; margin: 0; }
.lp-bottom { padding-top: 16px; }
.lp-bottom h2 { margin: 0; font-size: 1.4rem; line-height: 1.5; }
br.sp { display: none; }
@media (max-width: 640px) {
    .lp-hero { padding-top: 32px; }
    .lp-hero h1 { font-size: 1.5rem; }
    br.sp { display: inline; }
}

/* 写真のぼかし */
.blur-thumb { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.blur-thumb canvas { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.blur-thumb figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; }
.blur-thumb .link { font-size: .8rem; color: var(--primary-dark); text-decoration: underline; }
.blur-editor { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .9); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.blur-editor p { margin: 0; font-size: .9rem; text-align: center; }
.blur-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.blur-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; border-radius: 6px; }
.blur-editor .btn-ghost { color: #fff; }
.blur-btns { display: flex; gap: 10px; }
.blur-thumb .link-danger { color: var(--danger); }

/* 投稿の YouTube 動画 */
.video { margin: 12px 0 4px; }
.video-play, .video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; overflow: hidden; }
.video-play { position: relative; padding: 0; cursor: pointer; background: #000; }
.video-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px; border-radius: 12px; background: rgba(230, 33, 23, .9); color: #fff; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.video-play:hover .video-icon { background: #e62117; }
.video-link { margin: 0 0 12px; font-size: .88rem; text-align: right; }

/* 投稿送信中のぐるぐる */
.busy-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(255, 255, 255, .75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 600; }
.busy-overlay[hidden] { display: none; }
.spinner { width: 48px; height: 48px; border: 5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
