:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #22303a;
  --muted: #5c6b73;
  --line: #e7e3da;
  --sun: #f4a300;
  --sun-deep: #d97a06;
  --teal: #0f726a;
  --teal-soft: #e3f1ef;
  --sun-soft: #fdeecb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 48, 58, 0.06), 0 6px 20px rgba(34, 48, 58, 0.06);
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--teal); }
a:hover { color: var(--sun-deep); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 1000;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-sun {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd479, var(--sun) 60%, var(--sun-deep));
  box-shadow: 0 0 0 4px var(--sun-soft);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--muted); }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
}
.site-nav a:hover { background: var(--sun-soft); color: var(--sun-deep); }

/* Unofficial banner */
.unofficial-banner {
  background: var(--sun-soft);
  color: #6b4a00;
  font-size: 0.82rem;
  text-align: center;
  padding: 7px 16px;
  border-bottom: 1px solid #f0dca6;
}

/* Hero */
.hero { padding-top: 22px; padding-bottom: 6px; }
.hero-title { font-size: clamp(1.35rem, 4.5vw, 2rem); margin: 0 0 8px; line-height: 1.25; }
.hero-lead { color: var(--muted); margin: 0; max-width: 62ch; }

/* Controls */
.controls { padding-top: 16px; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--sun); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.select-label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--muted); gap: 4px; }
.select-label select {
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-width: 160px;
}

/* Map + list */
.map-list { display: grid; grid-template-columns: 1fr; gap: 18px; padding-top: 18px; padding-bottom: 40px; }
.map {
  height: 46vh;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #dfe7e6;
  z-index: 1;
}
.map-noscript { padding: 16px; color: var(--muted); }
.map-detail { height: 320px; margin-top: 18px; }

.list-count { font-size: 0.85rem; color: var(--muted); margin: 0 0 10px; }
.store-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.store-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}
.store-card.is-hidden { display: none; }
.store-card.is-highlight { outline: 3px solid var(--sun); outline-offset: 2px; }
.store-card-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.store-name { margin: 2px 0 6px; font-size: 1.08rem; }
.store-name a { text-decoration: none; color: var(--ink); }
.store-name a:hover { color: var(--sun-deep); }
.store-desc { margin: 0 0 8px; color: #384953; font-size: 0.92rem; }
.store-addr { margin: 0 0 10px; color: var(--muted); font-size: 0.85rem; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-exhibit { background: var(--sun-soft); color: #7a4d00; }
.badge-related { background: var(--teal-soft); color: #0b5850; }
.badge-cat { background: #eef1f0; color: #3a4a52; }
.badge-ev { border: 1px dashed #c9a24a; }
.badge-ev-B { background: #fff7e6; color: #8a5a00; }
.badge-ev-C { background: #f0eef7; color: #5b4b8a; border-color: #b9aede; }
.tag-area { font-size: 0.74rem; color: var(--muted); background: #f2f0ea; padding: 3px 8px; border-radius: 6px; }

/* Evidence C cards get a subtle treatment */
.store-card.evidence-C { border-style: dashed; }

/* Legend + C toggle */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 0; font-size: 0.78rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dot-exhibit { background: var(--sun); }
.dot-related { background: var(--teal); }
.dot-approx { background: repeating-conic-gradient(var(--sun) 0 25%, #fff 0 50%); opacity: 0.7; }
.toggle-c { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.85rem; color: var(--ink); cursor: pointer; }

/* Evidence notes on detail page */
.evidence-note { border-radius: 10px; padding: 10px 14px; font-size: 0.86rem; margin: 6px 0 4px; }
.evidence-note-b { background: #fff7e6; border: 1px solid #f0dca6; color: #6b4a00; }
.evidence-note-c { background: #f0eef7; border: 1px solid #cfc4ee; color: #4b3b7a; }
.coord-note { font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.store-detail-source { font-size: 0.8rem; color: var(--muted); word-break: break-all; margin-top: 14px; }

.store-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.btn:hover { border-color: var(--sun); color: var(--sun-deep); }
.btn-maps { background: var(--sun); color: #4a2f00; border-color: var(--sun); }
.btn-maps:hover { background: var(--sun-deep); color: #fff; }
.btn-detail { margin-left: auto; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* Store detail */
.store-detail { padding-top: 20px; padding-bottom: 44px; max-width: 780px; }
.breadcrumb { font-size: 0.85rem; margin-bottom: 8px; }
.store-detail-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.store-detail-name { margin: 8px 0 8px; font-size: clamp(1.4rem, 5vw, 2rem); }
.store-detail-desc { color: #384953; }
.store-detail-info dt { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.store-detail-info dd { margin: 2px 0 12px; }
.store-actions-detail { margin: 16px 0; }
.store-detail-note {
  background: #fff6e6;
  border: 1px solid #f0dca6;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #6b4a00;
  margin-top: 20px;
}

/* Prose pages */
.prose { padding-top: 24px; padding-bottom: 44px; max-width: 720px; }
.prose h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
.prose h2 { margin-top: 1.6em; font-size: 1.15rem; }
.prose ul { padding-left: 1.2em; }

/* Forms (submission / admin) */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 22px;
  box-shadow: var(--shadow);
  max-width: 640px;
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field .req { color: #c0392b; font-size: 0.8rem; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field input,
.field textarea,
.field select {
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  width: 100%;
  font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-primary {
  background: var(--sun);
  color: #4a2f00;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: var(--sun-deep); color: #fff; }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
}
.notice {
  background: var(--teal-soft);
  border: 1px solid #bfe0dc;
  color: #0b5850;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.notice-error { background: #fdecea; border-color: #f5c6c0; color: #922b21; }

/* Admin */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.admin-tabs a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--ink);
}
.admin-tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.88rem; vertical-align: top; }
.admin-table th { background: #f4f2ec; font-size: 0.8rem; color: var(--muted); }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #f6f4ee; padding: 24px 0 40px; margin-top: 20px; }
.footer-note { font-size: 0.82rem; color: var(--muted); margin: 0 0 10px; }
.footer-links { font-size: 0.88rem; margin: 0 0 8px; }
.footer-copy { font-size: 0.76rem; color: var(--muted); margin: 0; }

/* Desktop layout */
@media (min-width: 860px) {
  .map-list { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .map { position: sticky; top: 76px; height: calc(100vh - 120px); min-height: 460px; }
  .list-panel { max-height: none; }
}

/* Leaflet marker color hint */
.pin-exhibit { filter: hue-rotate(0deg); }
