:root {
  /* 参考サイト(rojiura.lovable.app)から実測した配色に合わせています */
  --bg: #F9F3E6;
  --surface: #FEFAF1;
  --surface-2: #E6D5BB;
  --ink: #1F1915;
  --ink-muted: #534B45;
  --accent: #BE4223;
  --accent-2: #3F6B62;
  --line: #D8CCBC;
  --line-strong: #B8A88F;
  --radius: 14px;
  /* 書体も参考サイトと同じ(このサイトのサーバーに置いて配信する) */
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* 上に付いてくるヘッダーの下に、ページ内の移動先(#list など)が隠れないように */
html { scroll-padding-top: 96px; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}
/* 公開ページ(ヘッダー・トップ・一覧)は参考サイトと同じ幅(最大1224px、左右の余白は17px、640px以上で25.5px)。
   管理画面は入力欄が横に間延びしないよう、上の880pxのまま */
.wrap.wide { max-width: 1224px; padding-left: 17px; padding-right: 17px; }
@media (min-width: 640px) { .wrap.wide { padding-left: 25.5px; padding-right: 25.5px; } }

/* ---------- Header ---------- */
/* 参考サイトと同じく、スクロールしても上に付いてくる半透明のヘッダー。
   地図(Leafletの部品は z-index 1000 まで使う)より上に出るよう、z-index は大きめにする */
header.site-header {
  position: sticky; top: 0; z-index: 1100;
  border-bottom: 1px solid rgba(216, 204, 188, 0.6);
  background: rgba(249, 243, 230, 0.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
/* サイト名・メニュー(中央)・空き の3つに分け、PCではメニューを真ん中に置く */
header.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 17px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-title {
  display: flex; flex-direction: column; justify-self: start; line-height: 1.25;
  font-family: var(--serif); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.025em;
  color: var(--ink); text-decoration: none;
}
@media (min-width: 640px) { .site-title { font-size: 1.5rem; } }
.site-title-lead {
  font-size: 0.72rem; font-weight: 500; color: var(--accent); letter-spacing: 0.12em;
  font-family: var(--sans);
}
.site-title-main { white-space: nowrap; }

/* ---------- 共通: 小さな線画アイコン ---------- */
.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* エリアの札(記事ページ・今週のおすすめ) */
.area-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: var(--surface-2); color: var(--ink); border-radius: 999px;
  padding: 3px 12px; font-size: 0.75rem; line-height: 1.6;
}
.area-pill .icon { color: var(--accent); width: 14px; height: 14px; }

/* ---------- トップ: 今週のおすすめ路地 ---------- */
.featured-section { padding-top: 48px; }
.section-eyebrow {
  margin: 0 0 12px; font-size: 0.875rem; letter-spacing: 0.2em; color: var(--accent);
}
.featured {
  display: grid;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}
.featured-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.featured-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.featured:hover .featured-photo img { transform: scale(1.03); }
.featured .body { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 24px; }
.featured h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.3;
  letter-spacing: 0.02em; margin: 0; color: var(--ink);
}
.featured p { color: var(--ink-muted); margin: 0; font-size: 1rem; line-height: 1.75; }
.featured .card-stats { margin: 0; font-size: 0.875rem; gap: 8px 20px; }
.featured .card-stats .icon { width: 16px; height: 16px; }
.read-button {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--accent); color: #fff; border-radius: 7px;
  padding: 12px 20px; font-size: 1rem; font-weight: 500; line-height: 1.5;
}
.featured:hover .read-button { opacity: 0.9; }
@media (min-width: 768px) {
  .featured { grid-template-columns: 1fr 1fr; }
  .featured-photo { aspect-ratio: auto; min-height: 420px; }
  .featured .body { padding: 42.5px; }
  .featured h2 { font-size: 2.25rem; }
}

/* ---------- トップ: みんなの旅行記 ---------- */
.list-section { padding: 56px 0 24px; }
.section-head { margin-bottom: 24px; }
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: 0.02em; margin: 0 0 4px; }
.section-head p { margin: 0; font-size: 0.875rem; color: var(--ink-muted); }
@media (min-width: 640px) { .section-head h2 { font-size: 1.875rem; } }

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-bar:has(+ .tag-bar) { margin-bottom: 14px; }
.filter-bar a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  color: var(--ink-muted);
}
.filter-bar a:hover { border-color: rgba(190, 66, 35, 0.5); color: var(--ink); }
.filter-bar a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* タグはエリアより控えめに(枠なしの小さな文字) */
.tag-bar { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0 0 28px; font-size: 0.82rem; }
.tag-bar a { color: var(--ink-muted); text-decoration: none; padding: 2px 0; }
.tag-bar a:hover { color: var(--accent); }
.tag-bar a.active { color: var(--accent); font-weight: 700; text-decoration: underline; }

.walk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25.5px;
  margin-bottom: 48px;
}
/* 参考サイトと同じく、640px以上で2列、1024px以上で3列 */
@media (min-width: 640px) { .walk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .walk-grid { grid-template-columns: repeat(3, 1fr); } }
.walk-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.walk-card:hover { border-color: rgba(190, 66, 35, 0.6); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.walk-card .thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #EBE4D5; }
.walk-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.walk-card:hover .thumb img { transform: scale(1.05); }
.walk-card .area {
  position: absolute; left: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(249, 243, 230, 0.9); color: var(--ink);
  border-radius: 999px; padding: 3px 12px; font-size: 0.75rem; font-weight: 500; line-height: 1.6;
}
.walk-card .area .icon { color: var(--accent); width: 12px; height: 12px; }
.walk-card .body { padding: 20px; }
.walk-card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.45; margin: 0 0 10px; color: var(--ink); }
.walk-card:hover h3 { color: var(--accent); }
.walk-card p {
  font-size: 0.875rem; line-height: 1.7; color: var(--ink-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.empty-state { color: var(--ink-muted); padding: 40px 0; text-align: center; }

/* ---------- 記事ページ ---------- */
.walk-narrow { max-width: 816px; margin: 0 auto; padding: 0 17px; }
@media (min-width: 640px) { .walk-narrow { padding: 0 25.5px; } }

/* 写真を画面幅いっぱいに。下の方を背景色にぼかし、タイトルの箱を重ねる */
.walk-hero-photo { position: relative; aspect-ratio: 16 / 10; max-height: 560px; width: 100%; overflow: hidden; background: #EBE4D5; }
.walk-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.walk-hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(249, 243, 230, 0.3) 50%, rgba(249, 243, 230, 0) 100%);
}
@media (min-width: 640px) { .walk-hero-photo { aspect-ratio: 16 / 8; } }
.walk-hero-inner { position: relative; padding-top: 24px; }
.walk-hero-inner.over-photo { margin-top: -96px; padding-top: 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px;
  font-size: 0.875rem; color: var(--ink-muted); text-decoration: none;
}
.back-link:hover { color: var(--accent); }
.back-link .icon { width: 16px; height: 16px; }
.walk-title-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}
.walk-title-card .area-pill { margin-bottom: 12px; }
.walk-title-card h1 {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.3;
  letter-spacing: 0.02em; margin: 0;
}
.walk-lead { margin: 16px 0 0; color: var(--ink-muted); line-height: 1.75; }
@media (min-width: 640px) {
  .walk-title-card { padding: 32px; }
  .walk-title-card h1 { font-size: 2.25rem; }
}

.walk-content { padding-top: 40px; padding-bottom: 8px; }
@media (min-width: 640px) { .walk-content { padding-top: 56px; } }
/* 本文: 段落ごとに左へ朱色の細い線 */
.walk-body p {
  margin: 0 0 28px; padding-left: 16px; border-left: 2px solid var(--accent);
  font-size: 1rem; line-height: 2; white-space: pre-line;
}
@media (min-width: 640px) { .walk-body p { font-size: 1.1rem; } }

.walk-section-title { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 56px 0 16px; }
@media (min-width: 640px) { .walk-section-title { font-size: 1.5rem; } }
.walk-body + .walk-section-title { margin-top: 28px; }

.route-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
#map { width: 100%; aspect-ratio: 3 / 2; max-height: 460px; background: #EBE4D5; }
.route-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0;
  background: var(--line); border-top: 1px solid var(--line);
}
.route-card > .route-stats:first-child { border-top: none; }
.route-stats > div { background: var(--surface); padding: 16px; text-align: center; }
.route-stats .icon { display: block; margin: 0 auto 4px; color: var(--accent); width: 16px; height: 16px; }
.route-stats dt { font-size: 0.75rem; color: var(--ink-muted); }
.route-stats dd { margin: 2px 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.route-go { border-top: 1px solid var(--line); padding: 20px; }
.route-go p { margin: 8px 0 0; text-align: center; font-size: 0.75rem; color: var(--ink-muted); }
.gmaps-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: #204569; color: #FBF5E8; text-decoration: none;
  padding: 16px 20px; border-radius: 7px; font-size: 1rem; font-weight: 500; line-height: 1.5;
}
.gmaps-button:hover { opacity: 0.9; }
.gmaps-button .icon { width: 20px; height: 20px; }

/* 地図の番号の印(Leaflet側の display:block より優先させるため、クラスを2つ重ねる) */
.leaflet-marker-icon.route-marker {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: 2px solid #fff; border-radius: 50%;
  font-family: var(--serif); font-size: 0.8rem; font-weight: 600; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.walk-subtitle { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 32px 0 12px; }
/* 立寄地点: 上の段にサムネイルと見出し、下の段に説明。歩く順に読めるよう、どの幅でも縦1列 */
.spot-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.spot-list .spot-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "photo name" "body body";
  gap: 12px 14px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.spot-list .spot-card.no-photo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "body"; }
.spot-list .spot-photo-wrap {
  grid-area: photo; position: relative; width: 112px; aspect-ratio: 4 / 3;
  border-radius: 6px; overflow: hidden; background: #EBE4D5;
}
@media (min-width: 768px) { .spot-list .spot-photo-wrap { width: 128px; } }
.spot-list .num {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 0.8rem; font-weight: 600;
}
.spot-list .spot-photo-wrap .num {
  position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; font-size: 0.7rem;
  border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); pointer-events: none;
}
.spot-list .name .num { margin-right: 10px; vertical-align: 1px; }
.spot-list .name { grid-area: name; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.6; overflow-wrap: anywhere; }
.spot-list .spot-body { grid-area: body; min-width: 0; }
.spot-list .desc { font-size: 0.9rem; line-height: 1.85; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.spot-list .spot-leg {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 0.8rem; color: var(--ink-muted);
}
.spot-list .desc + .spot-leg { margin-top: 10px; }
.spot-list .spot-body > .spot-leg:first-child { margin-top: 0; }
.spot-list .spot-leg .icon { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; }
.spot-list .spot-photo-link { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.spot-list .spot-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.spot-list .spot-photo-zoom {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.3); pointer-events: none;
}
.spot-list .spot-photo-zoom .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.spot-list .spot-photo-link:hover .spot-photo-zoom { background: #fff; color: var(--accent); }

/* 写真を大きく見る画面 */
.photo-viewer {
  max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; margin: 0; padding: 0;
  border: none; background: transparent;
}
.photo-viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.photo-viewer::backdrop { background: rgba(20, 16, 12, 0.94); }
.photo-viewer img {
  max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); object-fit: contain;
  border-radius: 6px; box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.photo-viewer-caption { margin: 0; padding: 0 16px; color: #fff; font-family: var(--serif); font-size: 1rem; text-align: center; }
.photo-viewer-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.photo-viewer-close:hover { background: rgba(255,255,255,0.28); }
.spot-note { margin: -4px 0 12px; font-size: 0.75rem; color: var(--ink-muted); }

.action-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 48px 0 0; padding-top: 32px; border-top: 1px solid var(--line);
}
@media (min-width: 640px) { .action-row { gap: 16px; } }
.action-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted);
  border-radius: 999px; padding: 12px 20px;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn .icon { width: 20px; height: 20px; }
.action-btn.liked { border-color: var(--accent); color: var(--accent); }
.action-btn.liked .icon { fill: currentColor; }
.like-count { font-variant-numeric: tabular-nums; }
/* スマホでは3つが1行に収まるよう少し詰める(「保存済み」になっても折り返さない) */
@media (max-width: 480px) { .action-row { gap: 6px; } .action-btn { padding: 10px 13px; gap: 5px; } .action-btn .icon { width: 18px; height: 18px; } }

/* ---------- Admin ---------- */
.admin-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.admin-bar .wrap { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.admin-bar a { font-size: 0.85rem; color: var(--ink-muted); text-decoration: none; }
.admin-bar span { font-size: 0.85rem; color: var(--ink-muted); }
.admin-bar form { display: flex; margin: 0; }
/* ログアウトはボタンなので、ブラウザ既定の行の高さ・すき間を消して、ほかのリンクと文字の高さをそろえる */
.admin-bar button {
  background: none; border: none; color: var(--ink-muted); cursor: pointer; font-size: 0.85rem; font-family: var(--sans);
  line-height: inherit; padding: 0; margin: 0;
}

.admin-table { width: 100%; border-collapse: collapse; margin: 24px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.admin-table th { background: var(--surface-2); }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; white-space: nowrap; }
.admin-table td:nth-child(3), .admin-table td:nth-child(4) { white-space: nowrap; }
.admin-table td:nth-child(5) a { margin-right: 10px; }
.status-pill.published { background: #E4EEEA; color: var(--accent-2); }
.status-pill.draft { background: var(--surface-2); color: var(--ink-muted); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
}
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: #B23A3A; }

.admin-form label { display: block; font-size: 0.85rem; color: var(--ink-muted); margin: 18px 0 6px; }
.admin-form input[type=text],
.admin-form input[type=number],
.admin-form input[type=password],
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}
.admin-form textarea { min-height: 120px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }

#admin-map { width: 100%; height: 360px; border-radius: var(--radius); border: 1px solid var(--line-strong); margin-top: 8px; }
.spot-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto auto auto;
  grid-template-areas:
    "num name photo up down del"
    ".   desc desc  desc desc desc";
  gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.spot-row > :nth-child(1) { grid-area: num; }
.spot-row > :nth-child(2) { grid-area: name; }
.spot-row > :nth-child(3) { grid-area: desc; }
.spot-row > :nth-child(4) { grid-area: photo; }
.spot-row > :nth-child(5) { grid-area: up; }
.spot-row > :nth-child(6) { grid-area: down; }
.spot-row > :nth-child(7) { grid-area: del; }
.spot-row .num { width: 24px; text-align: center; font-weight: 700; color: var(--accent); }
.spot-row textarea { min-height: 72px; resize: vertical; }

.login-box { max-width: 360px; margin: 80px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.login-box h1 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 20px; }
.form-error { color: #B23A3A; font-size: 0.85rem; margin-bottom: 12px; }

footer.site-footer { text-align: center; margin-top: 80px; padding: 40px 16px; border-top: 1px solid rgba(216, 204, 188, 0.6); color: var(--ink-muted); font-size: 0.8rem; }

/* 下書きプレビューの帯 */
.preview-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 20px 0 4px;
  font-size: 0.9rem;
  color: var(--ink);
}
.preview-bar a { color: var(--accent); }

/* ---------- 管理画面のメニュー ---------- */
.admin-nav, .admin-user { display: flex; gap: 16px; align-items: center; }
.admin-nav a, .admin-user span, .admin-user button { white-space: nowrap; }
.cell-actions { white-space: nowrap; }

/* エラー画面 */
.error-box { max-width: 560px; margin: 60px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.error-box h1 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 12px; }
.error-box p { margin: 0 0 14px; }
.error-box .error-hint { font-size: 0.9rem; color: var(--ink-muted); }

/* ---------- スマートフォン向け(管理画面) ---------- */
@media (max-width: 640px) {
  .admin-bar .wrap { flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; }
  .admin-nav { flex-wrap: wrap; gap: 6px 16px; }

  /* 立寄地点の行: 名前・説明を幅いっぱいにし、ボタンは3段目に並べる */
  .spot-row {
    display: grid;
    grid-template-columns: 24px 1fr 44px 44px 60px;
    grid-template-areas:
      "num name name name name"
      ".   desc desc desc desc"
      ".   photo up down del";
    gap: 6px;
    padding: 14px 0;
  }
  .spot-row > :nth-child(1) { grid-area: num; align-self: center; }
  .spot-row > :nth-child(2) { grid-area: name; }
  .spot-row > :nth-child(3) { grid-area: desc; }
  .spot-row > :nth-child(4) { grid-area: photo; display: flex; align-items: center; justify-content: center; }
  .spot-row > :nth-child(5) { grid-area: up; }
  .spot-row > :nth-child(6) { grid-area: down; }
  .spot-row > :nth-child(7) { grid-area: del; }
  .spot-row .btn { padding: 10px 0; text-align: center; width: 100%; min-width: 0; }
  .spot-row input, .spot-row textarea { width: 100%; min-width: 0; }
}

.notice-box { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px 18px; margin: 8px 0 18px; font-size: 0.92rem; line-height: 1.8; max-width: 560px; }
.field-hint { font-size: 0.78rem; color: var(--ink-muted); margin-top: 4px; }

/* ---------- パスワード再設定 ---------- */
.login-sub { text-align: center; font-size: 0.88rem; margin: 18px 0 0; }
.login-sub a { color: var(--ink-muted); }
.admin-form textarea#message { min-height: 0; }
.request-code { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 16px; margin: 16px 0; }
.request-code-label { font-size: 0.8rem; color: var(--ink-muted); }
.request-code-value { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; letter-spacing: 0.25em; color: var(--ink); }

.section-title { font-family: var(--serif); font-size: 1.15rem; margin-top: 40px; }
.count-badge { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; line-height: 1.5em; text-align: center; font-weight: 700; }
.role-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; white-space: nowrap; }
.role-pill.owner { background: var(--accent); color: #fff; }
.role-pill.editor { background: var(--surface-2); color: var(--ink); }
.role-pill.dev { background: #E3EAF2; color: #204569; }

/* パスワード変更の画面: どのアカウントを変えるのか */
.account-target { max-width: 420px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--surface); }
.account-target-label { font-size: 0.8rem; color: var(--ink-muted); }
.account-target-name { margin-top: 2px; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; overflow-wrap: anywhere; }
.account-target-name span { margin-left: 6px; font-family: var(--sans); font-weight: 400; font-size: 0.85rem; color: var(--ink-muted); }
.account-target-note { margin-top: 6px; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.7; }
.role-form { display: flex; gap: 6px; align-items: center; }
.role-form select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-family: var(--sans); font-size: 0.85rem; }
.role-form .btn { padding: 6px 12px; font-size: 0.82rem; }

.reset-section { margin-top: 28px; }
.reset-section h2 { font-family: var(--serif); font-size: 1.15rem; }
.reset-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.reset-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.reset-who { font-weight: 700; }
.reset-id { font-weight: 400; font-size: 0.85rem; color: var(--ink-muted); }
.reset-meta { font-size: 0.8rem; color: var(--ink-muted); }
.reset-code { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 6px 14px; flex: 0 0 auto; }
.reset-code-value { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.2em; }
.reset-message { margin: 10px 0 12px; font-size: 0.92rem; }
.reset-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.reset-history { margin-top: 8px; font-size: 0.85rem; color: var(--ink-muted); }
.reset-history summary { cursor: pointer; }

.temp-box { max-width: 620px; }
.temp-password { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 2rem; font-weight: 700; letter-spacing: 0.08em; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 18px; margin: 16px 0; user-select: all; word-break: break-all; }
.temp-steps { padding-left: 1.2em; font-size: 0.92rem; }
.temp-steps li { margin-bottom: 6px; }

@media (max-width: 640px) {
  .reset-head { flex-direction: column-reverse; }
  .reset-code { align-self: stretch; }
  .reset-actions form, .reset-actions .btn { width: 100%; }
  .temp-password { font-size: 1.5rem; }
}
.admin-bar .count-badge { color: #fff; font-size: 0.72rem; }
@media (min-width: 901px) { .admin-table .cell-area { white-space: nowrap; } }

/* ---------- 地図エディタ: 地名・住所で探す / 現在地 ---------- */
.map-tools { display: flex; gap: 8px; margin-top: 8px; }
.map-tools input[type=search] {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  font-family: var(--sans); font-size: 0.95rem; background: var(--surface); color: var(--ink);
}
.map-tools .btn { white-space: nowrap; }
.map-tools-status { font-size: 0.85rem; color: var(--ink-muted); min-height: 1.4em; margin: 6px 0 4px; }
.place-results { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); overflow: hidden; }
.place-results li + li { border-top: 1px solid var(--line); }
.place-results button {
  display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 14px;
  font-family: var(--sans); cursor: pointer; color: var(--ink);
}
.place-results button:hover, .place-results button:focus-visible { background: var(--surface-2); }
.place-name { display: block; font-weight: 500; font-size: 0.95rem; }
.place-detail { display: block; font-size: 0.78rem; color: var(--ink-muted); }
.route-summary { margin: 10px 0 4px; padding: 10px 12px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font-size: 0.9rem; }
.route-summary[hidden] { display: none; }
.route-summary .route-summary-legs { margin-top: 4px; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.7; }
.route-summary .btn { margin-top: 8px; }
.map-tools-credit { font-size: 0.72rem; color: var(--ink-muted); text-align: right; margin-top: 4px; }
@media (max-width: 640px) {
  .map-tools { flex-wrap: wrap; }
  .map-tools input[type=search] { flex: 1 1 100%; }
  .map-tools .btn { flex: 1; }
}

/* 記事ページ: 出発・到着の印 */
.spot-role { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 8px; vertical-align: 2px; }
.spot-role.start { background: var(--accent); color: #fff; }
.spot-role.goal { background: var(--ink); color: #fff; }

/* ---------- 使い方ページ(年配の方にも読みやすく: 大きめの文字・広い行間) ---------- */
.help-hint { font-size: 0.9rem; color: var(--ink-muted); margin: 0 0 8px; }
.help-hint a { color: var(--accent); }
.help-page { font-size: 1.12rem; line-height: 2; padding-bottom: 40px; }
.help-page h1 { font-family: var(--serif); font-size: 1.9rem; margin: 8px 0 8px; }
.help-page h2 { font-family: var(--serif); font-size: 1.45rem; margin: 48px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.help-page h3 { font-family: var(--serif); font-size: 1.2rem; margin: 28px 0 8px; }
.help-page section { scroll-margin-top: 16px; }
.help-back { font-size: 0.95rem; margin: 20px 0 0; }
.help-back a { color: var(--ink-muted); }
.help-back-bottom { margin-top: 48px; }
.help-lead { color: var(--ink-muted); }
.help-no { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--sans); font-size: 1rem; flex: 0 0 auto; }
.help-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 20px 0 8px; }
.help-toc ol { margin: 0; padding-left: 1.6em; columns: 2; column-gap: 32px; }
.help-toc a { color: var(--ink); }
.help-steps { padding-left: 0; list-style: none; counter-reset: step; margin: 8px 0; }
.help-steps > li { counter-increment: step; position: relative; padding: 10px 0 10px 2.6em; border-bottom: 1px dashed var(--line); }
.help-steps > li:last-child { border-bottom: none; }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; line-height: 1; }
.help-fields { margin: 6px 0 0; padding-left: 1.2em; }
.help-fields li { margin-bottom: 6px; }
.help-tips { padding-left: 1.3em; }
.help-tips li { margin-bottom: 8px; }
.help-note, .help-warn { border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: 1.02rem; }
.help-note { background: var(--surface); border: 1px solid var(--line); }
.help-note::before { content: "メモ  "; font-weight: 700; color: var(--accent-2); }
.help-warn { background: #FBE9E5; border: 1px solid #E8B7AB; }
.help-warn::before { content: "ご注意  "; font-weight: 700; color: var(--accent); }
.help-faq dt { font-weight: 700; margin-top: 18px; }
.help-faq dd { margin: 4px 0 0; padding-left: 1em; border-left: 3px solid var(--surface-2); }
/* 画面のボタン・リンクと同じ見た目の見本(「この形を押す」と目で探せるように) */
.ui-btn { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 0 10px; font-size: 0.92em; line-height: 1.8; white-space: nowrap; vertical-align: 1px; }
.ui-btn.sub { background: var(--surface-2); color: var(--ink); }
.ui-btn.danger { background: #B23A3A; }
.ui-link { text-decoration: underline; white-space: nowrap; }
.ui-link.danger { color: #B23A3A; }
@media (max-width: 640px) {
  .help-page { font-size: 1.06rem; }
  .help-toc ol { columns: 1; }
  .help-page h2 { font-size: 1.3rem; }
  .ui-btn { white-space: normal; }
}

/* ---------- 表(記事一覧・管理者一覧): スマホとタブレット(900px以下)は1件ずつのカード ---------- */
/* タブレットの縦向き(768px)でも、列が細くなって「ユーザー名」や「変更」ボタンが途中で折り返したため */
@media (max-width: 900px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .admin-table tr:last-child { border-bottom: none; }
  .admin-table td { border: none; padding: 2px 0; white-space: normal !important; }
  .admin-table td:first-child { font-weight: 500; font-size: 1rem; margin-bottom: 4px; }
  .admin-table .cell-area, .admin-table td:nth-child(3), .admin-table .cell-date { display: inline-block; width: auto; margin-right: 10px; font-size: 0.82rem; color: var(--ink-muted); }
  .admin-table .cell-date::before { content: attr(data-label) " "; }
  .admin-table .cell-actions { margin-top: 10px; display: flex; gap: 18px; align-items: center; font-size: 0.95rem; }
  .admin-table .cell-area:empty { display: none; }
  .admin-table .cell-role { margin-top: 8px; }
}

/* ---------- 指で押しやすく: スマホ幅と、タッチ操作の端末(タブレットを含む) ---------- */
/* 年配の方が使うので、押せるものは高さ44px(Appleの推奨)を確保する */
@media (max-width: 640px), (pointer: coarse) {
  .admin-nav a, .admin-user button, .footer-admin, .site-nav a,
  .login-sub a, .help-back a, .help-hint a, .preview-bar a, .empty-state a,
  .error-box a:not(.btn), .admin-table .cell-actions a, .admin-table .cell-actions button {
    display: inline-flex; align-items: center; min-height: 44px; padding-left: 4px; padding-right: 4px;
  }
  .admin-bar .wrap { padding-top: 2px; padding-bottom: 2px; }
  .admin-user span { padding-left: 4px; } /* 上の行のリンク(左右4px)と左端をそろえる */
  .admin-form input[type=checkbox] { width: 22px; height: 22px; vertical-align: -5px; }
  .admin-form input[type=file] { min-height: 44px; }
  .role-form select, .role-form .btn { min-height: 40px; }
}

/* 小さいスマホ(320px前後)で、ログイン・申請の箱の見出しが「再設/定」のように途中で折れないように */
@media (max-width: 400px) {
  .login-box { padding: 24px 20px; margin: 40px auto; }
  .login-box h1 { font-size: 1.25rem; }
}

/* ---------- メニューの「読む」「歩く」(参考サイトに合わせる) ---------- */
/* PC(768px以上): ヘッダーの中央。スマホ: 画面の下に固定したタブ(親指で押しやすい) */
.site-nav { display: none; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 17px; border-radius: 7px;
  font-size: 1rem; font-weight: 500; line-height: 1.5; color: var(--ink-muted); text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.site-nav a:hover { background: rgba(230, 213, 187, 0.6); color: var(--ink); }
.site-nav a.active { background: var(--surface-2); color: var(--ink); }
.site-nav .icon { width: 20px; height: 20px; }
@media (min-width: 768px) { .site-nav { display: flex; gap: 4px; align-items: center; } }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  border-top: 1px solid var(--line);
  background: rgba(249, 243, 230, 0.95);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 448px; display: flex; justify-content: space-around; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 64px; padding: 8px; font-size: 0.75rem; font-weight: 500; line-height: 1.3;
  color: var(--ink-muted); text-decoration: none;
}
.bottom-nav a.active { color: var(--accent); }
/* iPhoneで押した瞬間に出る灰色の四角を、サイトの色の薄い影にする */
.bottom-nav a, .site-nav a { -webkit-tap-highlight-color: rgba(190, 66, 35, 0.08); }
.bottom-nav .icon { width: 24px; height: 24px; }
@media (min-width: 768px) { .bottom-nav { display: none; } }
/* スマホでは、ページの一番下(フッター)が下のタブに隠れないよう余白を足す */
@media (max-width: 767px) { footer.site-footer { padding-bottom: calc(112px + env(safe-area-inset-bottom)); } }

/* フッター(編集する人向けの「管理画面」は控えめに) */
.site-footer .footer-name { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.site-footer .footer-copy { margin: 16px 0 6px; font-size: 0.75rem; color: rgba(83, 75, 69, 0.7); }
.footer-admin { color: var(--ink-muted); font-size: 0.75rem; }

/* ---------- 「歩く」の一覧ページ ---------- */
.list-head { margin: 28px 0 16px; }
.list-head h1 { font-family: var(--serif); font-size: 1.8rem; margin: 0; }
.list-count { color: var(--ink-muted); font-size: 0.85rem; margin: 4px 0 0; }

/* 記事カードの距離・時間・立寄の数 */
.card-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 12px; font-size: 0.75rem; color: var(--ink-muted); }
.card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.card-stats .icon { width: 14px; height: 14px; }

/* 管理者の一覧の見出しに出す「今の人数 / 上限」 */
.admin-count { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--ink-muted); margin-left: 8px; }
