:root {
  --bg: #f6f6f0;
  --surface: #fff;
  --ink: #202820;
  --muted: #687064;
  --line: #dddeda;
  --water: #2f6f96;
  --water-ink: #fff;
  --water-soft: #e2edf3;
  --sand: #ece5d6;
  --sat: #2f6f96;
  --sun: #b4453a;
  --warn: #8a5a12;
  --warn-soft: #f6ecd6;
  --stop: #a33a32;
  --focus: #b39cfc;
  --shadow: 0 10px 28px #20302a0d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131a19;
    --surface: #1b2322;
    --ink: #e6eae3;
    --muted: #9ba49c;
    --line: #2d3735;
    --water: #86bcdc;
    --water-ink: #10202a;
    --water-soft: #1c3240;
    --sand: #2f2b23;
    --sat: #86bcdc;
    --sun: #ee8f84;
    --warn: #e7bf74;
    --warn-soft: #352b17;
    --stop: #ee8f84;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #131a19;
  --surface: #1b2322;
  --ink: #e6eae3;
  --muted: #9ba49c;
  --line: #2d3735;
  --water: #86bcdc;
  --water-ink: #10202a;
  --water-soft: #1c3240;
  --sand: #2f2b23;
  --sat: #86bcdc;
  --sun: #ee8f84;
  --warn: #e7bf74;
  --warn-soft: #352b17;
  --stop: #ee8f84;
  --shadow: none;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic",
    sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 6px 12px;
  z-index: 10;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

/* ヘッダー */
.top {
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
}
.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a[aria-current="page"] {
  background: var(--water-soft);
  font-weight: 700;
}

/* 見出し */
.lead {
  padding: 28px 0 8px;
}
.lead h1 {
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.4;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
}
.lead p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* 日付ストリップ */
.days {
  position: relative;
  margin: 16px 0 0;
}
.days-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}
.day {
  flex: 0 0 auto;
  width: 52px;
  min-height: 68px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  scroll-snap-align: start;
  padding: 6px 0;
}
.day .m {
  font-size: 10px;
  color: var(--muted);
  height: 12px;
}
.day .d {
  font-size: 18px;
  font-weight: 700;
}
.day .w {
  font-size: 11px;
}
.day .n {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.day.sat .w {
  color: var(--sat);
}
.day.sun .w {
  color: var(--sun);
}
.day.zero .d {
  color: var(--muted);
  font-weight: 500;
}
.day[aria-pressed="true"] {
  background: var(--water);
  color: var(--water-ink);
  border-color: var(--water);
}
.day[aria-pressed="true"] .m,
.day[aria-pressed="true"] .n,
.day[aria-pressed="true"] .w {
  color: inherit;
}

/* 検索・絞り込み */
.tools {
  display: grid;
  gap: 12px;
  margin: 12px 0 8px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  min-height: 48px;
}
.search input {
  border: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  outline: none;
}
.search:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.search button {
  border: 0;
  background: none;
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips-label {
  font-size: 12px;
  color: var(--muted);
  width: 100%;
  margin-bottom: -2px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 40px;
  font-size: 13px;
}
.chip[aria-pressed="true"] {
  background: var(--water);
  color: var(--water-ink);
  border-color: var(--water);
  font-weight: 700;
}
details.more summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
details.more[open] summary {
  margin-bottom: 8px;
}
details.more .chips + .chips {
  margin-top: 12px;
}

/* 一覧・カード */
.status {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 8px;
  min-height: 1.8em;
}
.list {
  display: grid;
  gap: 12px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
@media (min-width: 860px) {
  .list {
    grid-template-columns: 1fr 1fr;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-margin-top: 16px;
}
.card.hit {
  outline: 3px solid var(--water);
  outline-offset: 2px;
}
.card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}
.card h3 a {
  text-decoration: none;
}
.card h3 a:hover {
  text-decoration: underline;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--sand);
  white-space: nowrap;
}
.tag.kamo {
  background: var(--water-soft);
  color: var(--water);
  font-weight: 700;
}
.tag.unsure {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.stop {
  background: var(--stop);
  color: #fff;
  font-weight: 700;
}
.tag .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 0;
}
.card p.desc {
  margin: 0;
}
.facts {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 2px 10px;
  margin: 4px 0 0;
  font-size: 13px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.notice {
  font-size: 13px;
  background: var(--warn-soft);
  color: var(--warn);
  padding: 6px 10px;
  border-radius: 8px;
  margin: 2px 0 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
}
.btn.primary {
  background: var(--water);
  border-color: var(--water);
  color: var(--water-ink);
  font-weight: 700;
}
.next {
  font-size: 13px;
  color: var(--water);
  font-weight: 700;
}

/* 0件・エラー */
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  margin: 0 0 40px;
}
.empty p {
  margin: 0 0 12px;
}
.empty .actions {
  justify-content: center;
}

/* フッター */
.foot {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  font-size: 12px;
  color: var(--muted);
}
.foot p {
  margin: 0 0 6px;
}

/* 鴨川特集 */
.kamo-hero {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 24px 0 8px;
}
@media (min-width: 760px) {
  .river {
    max-width: 300px;
  }
  .kamo-hero {
    grid-template-columns: 1fr 300px;
    gap: 32px;
  }
}
.kamo-hero h1 {
  font-size: clamp(24px, 6vw, 34px);
  margin: 0 0 8px;
  line-height: 1.35;
}
.kamo-hero p {
  margin: 0 0 8px;
}
.river {
  width: 100%;
  max-width: 240px;
  justify-self: center;
  color: var(--water);
}
.river a {
  cursor: pointer;
}
.river .band {
  fill: transparent;
}
.river a:hover .band,
.river a:focus-visible .band {
  fill: var(--water-soft);
}
.river text {
  fill: var(--ink);
  font-size: 12px;
}
.river text.bridge {
  fill: var(--muted);
  font-size: 10px;
}
.toc a {
  text-decoration: none;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}
.block {
  padding: 28px 0 8px;
}
.block > h2 {
  font-size: 20px;
  margin: 0 0 4px;
}
.block > p.sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.sections {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 860px) {
  .sections {
    grid-template-columns: 1fr 1fr;
  }
}
.section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--water);
  border-radius: 12px;
  padding: 16px 18px;
  scroll-margin-top: 16px;
}
.section-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.section-card .count {
  font-size: 12px;
  color: var(--water);
  font-weight: 700;
}
.every {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 14px;
}
.every ul,
.month ul {
  margin: 4px 0 0;
  padding-left: 1.2em;
}
.months {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) {
  .months {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  .months {
    grid-template-columns: repeat(3, 1fr);
  }
}
.month {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
}
.month.now {
  border: 2px solid var(--water);
}
.month h3 {
  margin: 0;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.month h3 span {
  font-size: 11px;
  color: var(--water);
}
.month .none {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}
.month li {
  margin: 4px 0;
}
.month ul.dated {
  border-top: 1px dashed var(--line);
  padding-top: 4px;
  list-style: "● ";
}
.month ul.dated li::marker {
  color: var(--water);
}
.when {
  color: var(--muted);
  font-size: 12px;
}
.sure {
  font-size: 11px;
  white-space: nowrap;
}
.sure.yes {
  color: var(--water);
}
.sure.no {
  color: var(--warn);
}
.rules,
.trivia {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px 14px 34px;
  margin: 0;
}
.rules li,
.trivia li {
  margin: 6px 0;
}
.src {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

/* このサイトについて */
.prose {
  max-width: 720px;
  padding: 8px 0 40px;
}
.prose h2 {
  font-size: 18px;
  margin: 28px 0 6px;
}
.prose p,
.prose li {
  margin: 0 0 8px;
}

/* お気に入り・カレンダー */
.btn.fav .star::before {
  content: "☆";
  margin-right: 4px;
}
.btn.fav[aria-pressed="true"] {
  border-color: var(--warn);
  color: var(--warn);
  font-weight: 700;
}
.btn.fav[aria-pressed="true"] .star::before {
  content: "★";
}
details.cal {
  position: relative;
}
details.cal summary {
  list-style: none;
  cursor: pointer;
}
details.cal summary::-webkit-details-marker {
  display: none;
}
details.cal .menu {
  position: absolute;
  z-index: 5;
  left: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px #0000002a;
  padding: 6px;
}
.menu-note {
  margin: 4px 10px 6px;
  font-size: 12px;
  color: var(--muted);
}
.menu-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
}
.menu-item:hover {
  background: var(--water-soft);
}

/* 地図 */
.results {
  display: grid;
  gap: 16px;
}
.map-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.map-box[hidden] {
  display: none;
}
#map {
  height: 280px;
}
.map-note {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 500;
  font-size: 11px;
  background: var(--surface);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 8px;
}
@media (min-width: 1000px) {
  .results {
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
  }
  .results .list {
    grid-template-columns: 1fr;
  }
  .map-box {
    position: sticky;
    top: 16px;
    order: 2;
  }
  #map {
    height: calc(100vh - 32px);
    max-height: 720px;
  }
}
.leaflet-container {
  font: inherit;
  background: var(--water-soft);
}
.leaflet-popup-content {
  margin: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.leaflet-popup-content a.pop-title {
  font-weight: 700;
  color: #2f6f96;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane {
    filter: brightness(0.75) contrast(1.1) saturate(0.7);
  }
}
:root[data-theme="dark"] .leaflet-tile-pane {
  filter: brightness(0.75) contrast(1.1) saturate(0.7);
}
