@import url('https://fonts.googleapis.com/css2?family=Yomogi&display=swap');

:root {
  --bg: #FDFBF6;
  --card-bg: #ffffff;
  --text: #3A2F28;
  --text-muted: #6B5D52;

  --river-pale: #EAF2F5;
  --river-deep: #3A5F6E;
  --river-highlight: #D8E9EE;

  --mtn-pale: #EEF1EA;
  --mtn-deep: #4F5C49;

  --accent: var(--river-deep);
  --accent-bg: var(--river-pale);

  --taupe-text: #5B5146;
  --taupe-light: #F5F1EC;
  --taupe-mid: #E8DFD2;
  --taupe-dark: #D3C4AE;

  --primary-support-bg: #2C6478;
  --primary-event-bg: #5C7A3E;

  --divider: #ECE3D4;

  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  padding-bottom: 2rem;
}

.hw {
  font-family: 'Yomogi', cursive;
  font-weight: 400;
}

.page-container {
  max-width: 640px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.header {
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}
.header h1 {
  margin: 0;
}
.header .site-brand {
  margin: 0 0 0.25rem;
}
.header .lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

main {
  padding-top: 0;
  padding-bottom: 0;
}

.section {
  margin-top: 1.5rem;
}

.view-switch {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--divider);
}
.view-tab {
  position: relative;
  border: none;
  background: none;
  padding: 6px 1px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.view-tab.is-active {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}
.view-tab .wavy-underline {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  width: calc(100% + 8px);
  height: 8px;
  visibility: hidden;
}
.view-tab.is-active .wavy-underline {
  visibility: visible;
}

.view-panel {
  display: none;
  margin-top: 1.1rem;
}
.view-panel.is-active {
  display: block;
}
.section h2 {
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  color: var(--river-deep);
}
.section > .lead {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 0.75rem;
}

.link-btn {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--river-deep);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.link-btn::after {
  content: " ›";
}
.link-btn.is-muted {
  color: var(--text-muted);
}
.link-btn.is-muted::after {
  content: "";
}

.legend {
  background: var(--river-pale);
  border-radius: 10px;
  padding: 2px 18px;
  margin-bottom: 14px;
  font-size: 14px;
}
.legend summary {
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.legend ul {
  margin: 0 0 10px;
  padding-left: 20px;
}
.legend li {
  margin-bottom: 6px;
}

.week-strip {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  margin-bottom: 6px;
}
.week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 6px 0 7px;
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.week-day.is-active {
  background: var(--river-pale);
}
.week-day-label {
  font-size: 11px;
  color: var(--text-muted);
}
.week-day.is-active .week-day-label,
.week-day.is-today .week-day-label {
  color: var(--river-deep);
  font-weight: 700;
}
.week-day-num {
  font-size: 15px;
  color: var(--text);
}
.week-day.is-active .week-day-num {
  color: var(--river-deep);
  font-weight: 700;
}
.week-day-label.is-sun-holiday,
.week-day-num.is-sun-holiday {
  color: #B5473A;
}
.week-day-label.is-sat,
.week-day-num.is-sat {
  color: #3A5F6E;
}
.week-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-top: 1px;
}
.week-strip-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 16px;
}

.day-card {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.day-card-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.day-card-date {
  font-size: 22px;
  color: var(--river-deep);
}
.day-card-holiday {
  font-size: 13px;
  font-weight: 600;
  color: #B5473A;
}
.event-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}
.event-row:last-child {
  border-bottom: none;
}
.event-row-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.event-dot.dot-official {
  background: var(--river-deep);
}
.event-dot.dot-community {
  background: var(--mtn-deep);
}
.event-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffffff;
}
.event-label.label-official {
  background: var(--primary-support-bg);
}
.event-label.label-community {
  background: var(--primary-event-bg);
}
.event-title {
  font-size: 16px;
  display: block;
  margin-top: 0.25rem;
  margin-left: 20px;
}
.event-row-meta {
  margin-top: 6px;
  margin-left: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.event-place {
  font-weight: 600;
  color: var(--text);
}

.upcoming {
  margin-top: 20px;
}
.upcoming h3 {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.upcoming-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0.5rem 0;
  border-top: 1px solid var(--divider);
}
.upcoming-row:first-child {
  border-top: none;
}
.upcoming-date {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--river-deep);
  width: 4.4em;
  flex-shrink: 0;
}
.upcoming-body {
  min-width: 0;
}
.upcoming-title {
  font-size: 13.5px;
  display: block;
}
.upcoming-place {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.category-chip {
  min-height: 44px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--chip-color);
  border: 1px solid var(--chip-color);
  -webkit-tap-highlight-color: transparent;
}
.category-chip.is-active {
  background: var(--chip-color);
  color: #ffffff;
}
.age-filter-btn {
  min-height: 44px;
  padding: 3px 10px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 12px;
  -webkit-tap-highlight-color: transparent;
}
.age-filter-btn.is-active {
  background: var(--river-pale);
  border-color: var(--river-deep);
  color: var(--river-deep);
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.month-nav-btn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--river-deep);
  padding: 4px 10px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.month-nav-btn:disabled {
  color: #D8CFC2;
  cursor: default;
}
.month-label {
  font-size: 19px;
  color: var(--river-deep);
}
.weekday-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.weekday-header {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0.25rem 0;
}
.weekday-header.is-sun-holiday {
  color: #B5473A;
}
.weekday-header.is-sat {
  color: #3A5F6E;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.75rem;
}
.calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  padding: 5px 0;
  -webkit-tap-highlight-color: transparent;
}
.calendar-cell.is-empty {
  visibility: hidden;
  border: none;
  background: none;
  min-height: 40px;
  cursor: default;
}
.calendar-cell.is-today {
  border-color: var(--river-deep);
}
.calendar-cell.is-selected {
  background: var(--river-pale);
}
.calendar-cell-num {
  font-size: 13px;
  color: var(--text);
}
.calendar-cell.is-today .calendar-cell-num {
  font-weight: 700;
}
.calendar-cell.is-selected .calendar-cell-num {
  color: var(--river-deep);
  font-weight: 700;
}
.calendar-cell-num.is-sun-holiday {
  color: #B5473A;
}
.calendar-cell-num.is-sat {
  color: #3A5F6E;
}
.calendar-cell-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.search-result-group {
  margin-bottom: 1rem;
}
.search-result-date {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 6px 0;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--river-deep);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
  -webkit-tap-highlight-color: transparent;
}
.search-result-date::after {
  content: " ›";
}
.search-result-group .event-row {
  padding: 10px 0;
}

.open-facilities {
  padding-top: 20px;
}
.open-facilities-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.open-facilities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.facility-jump-chip {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--river-deep);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.facility-jump-chip::after {
  content: " ›";
}

.age-badge {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.source-link {
  color: var(--text-muted);
  text-decoration: underline;
  font-weight: 400;
}
.source-paper {
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
}
.loading {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 1.5rem 0;
}

#facility-groups {
  margin-top: 16px;
}


.facility-search-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.facility-search-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}
.facility-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.facility-type-chip {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}
.facility-type-chip.is-active {
  background: var(--taupe-mid);
  border-color: var(--taupe-text);
  color: var(--taupe-text);
  font-weight: 600;
}
.facility-favorite-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--card-bg);
  font-size: 13px;
  min-height: 40px;
  padding: 6px 14px;
  margin-bottom: 4px;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.facility-favorite-toggle.is-active {
  color: #a6790a;
  border-color: #a6790a;
  background: #fff8e8;
}

.facility-type-group {
  margin-bottom: 14px;
}
summary.facility-group-summary {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
  min-height: 44px;
  list-style: none;
  padding: 8px 14px;
  border-radius: 10px;
  margin: 0;
  background: var(--taupe-light);
  -webkit-tap-highlight-color: transparent;
}
summary.facility-group-summary::-webkit-details-marker {
  display: none;
}
summary.facility-group-summary::after {
  content: "›";
  display: inline-block;
  margin-left: auto;
  font-weight: 700;
  font-size: 14px;
  color: var(--group-color);
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}
details[open] > summary.facility-group-summary::after {
  transform: rotate(90deg);
}
.facility-group-label {
  color: var(--group-color);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.facility-group-body {
  padding-top: 10px;
}

.facility-card {
  margin-bottom: 12px;
  border: 1px solid var(--divider);
  border-radius: 10px;
}
.facility-card.is-highlighted {
  animation: facility-highlight 1.9s ease;
}
@keyframes facility-highlight {
  0% {
    background: var(--card-bg);
    border-color: var(--divider);
    box-shadow: none;
    transform: scale(1);
  }
  10% {
    background: var(--river-highlight);
    border-color: var(--river-deep);
    box-shadow: 0 0 0 3px rgba(58, 95, 110, 0.22);
    transform: scale(1.015);
  }
  45% {
    background: var(--river-highlight);
    border-color: var(--river-deep);
    box-shadow: 0 0 0 3px rgba(58, 95, 110, 0.22);
    transform: scale(1.015);
  }
  100% {
    background: var(--card-bg);
    border-color: var(--divider);
    box-shadow: none;
    transform: scale(1);
  }
}
.facility-card-body {
  padding: 12px 16px;
}
.facility-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.facility-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}
.fname {
  font-weight: 400;
  font-size: 18px;
  color: var(--river-deep);
}
.support-name {
  color: var(--text-muted);
  font-size: 14px;
}
.address {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.programs {
  margin-top: 6px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.program-row .label {
  color: var(--text-muted);
  display: inline-block;
  width: 6.2em;
  white-space: nowrap;
}
.phone {
  margin-top: 0.5rem;
  font-size: 13px;
}
.phone a {
  color: var(--river-deep);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.source {
  margin-top: 4px;
  font-size: 13px;
}
.source a {
  color: var(--river-deep);
  text-decoration: none;
  font-weight: 600;
}
.source a::after {
  content: " ›";
}
.source-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.closure-notice {
  margin-top: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: #fff8e8;
  color: #a6790a;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
}
.community-tip {
  margin-top: 0.4rem;
  padding: 0.5rem 0.6rem;
  background: var(--mtn-pale);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--mtn-deep);
}
.community-tip a {
  color: var(--mtn-deep);
  text-decoration: none;
  font-weight: 600;
}

.favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--card-bg);
  font-size: 11.5px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.favorite-btn.is-active {
  color: #a6790a;
  border-color: #a6790a;
  background: #fff8e8;
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 24px;
}
.footer-links {
  margin-top: 0.4rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: underline;
}

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-page-inner {
  max-width: 420px;
  text-align: center;
  padding-top: 24px;
  padding-bottom: 24px;
}
.error-page-code {
  position: relative;
  display: inline-block;
  font-size: 64px;
  color: var(--river-deep);
  margin-bottom: 20px;
}
.error-page-code .error-page-underline {
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: 2px;
  width: calc(100% + 12px);
  height: 8px;
}
.error-page-text {
  font-size: 15px;
  margin: 0 0 28px;
  color: var(--text);
}
.error-page-link {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--river-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.legal-page {
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}
.legal-page-inner {
  padding-top: 20px;
  padding-bottom: 96px;
}
.legal-page-brand {
  margin-bottom: 20px;
}
.site-brand {
  font-family: 'Yomogi', cursive;
  font-weight: 400;
  font-size: 22px;
  color: var(--river-deep);
  text-decoration: none;
  display: inline-block;
}
.legal-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 32px;
}
.legal-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 2px;
  cursor: pointer;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.legal-tab.is-active {
  font-weight: 700;
  color: var(--river-deep);
  border-bottom-color: var(--river-deep);
}
.legal-panel {
  display: none;
}
.legal-panel.is-active {
  display: block;
}
.legal-panel h1 {
  font-family: 'Yomogi', cursive;
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 20px;
  color: var(--text);
}
.legal-panel h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--river-deep);
}
.legal-panel p {
  font-size: 14px;
  margin: 0 0 20px;
  color: var(--text);
}
.legal-panel a {
  color: var(--river-deep);
}
.legal-updated {
  font-size: 13px;
  color: #8A7A6C;
  margin: 0 0 24px;
}
.legal-table {
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
}
.legal-table-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
}
.legal-table-label {
  color: var(--text-muted);
  font-weight: 600;
}
.legal-contact-intro {
  margin: 0 0 24px;
}
.legal-contact-pending {
  background: var(--river-pale);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.legal-back-link {
  display: inline-block;
  margin-top: 40px;
  min-height: 44px;
  line-height: 44px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--river-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
