/* no-jisui 飯マップ：食券機と食券をモチーフにした部品 */
.njm {
  --njm-ink: #1d2327;
  --njm-sub: #4f5a62;
  --njm-main: var(--color_main, #0b6b4b);
  --njm-main-ink: #ffffff;
  --njm-paper: #ffffff;
  --njm-wash: #f4f1ea;
  --njm-line: #d9d3c7;
  --njm-warn: #b3261e;
  --njm-r: 8px;
  --njm-pad: 16px;
  container-type: inline-size;
  margin: 32px 0;
  padding: 24px var(--njm-pad);
  border: 1px solid var(--njm-line);
  border-radius: 16px;
  background: var(--njm-wash);
  color: var(--njm-ink);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .02em;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}
.njm *, .njm *::before, .njm *::after { box-sizing: border-box; }
.njm p { margin: 0; }
.njm button { font: inherit; letter-spacing: inherit; cursor: pointer; }
.njm button:disabled { cursor: progress; opacity: .6; }
.njm :focus-visible { outline: 3px solid var(--njm-main); outline-offset: 2px; }

.njm-head { margin-bottom: 24px; }
.njm-kicker {
  display: inline-block;
  margin-bottom: 8px !important;
  padding: 0 8px;
  border: 1px solid var(--njm-ink);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: .08em;
}
.njm .njm-title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--njm-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .02em;
  font-feature-settings: "palt";
  text-wrap: balance;
  word-break: auto-phrase;
}
.njm .njm-title::before, .njm .njm-title::after { display: none; content: none; }
.njm-lead { color: var(--njm-sub); }

.njm-ask {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--njm-paper);
  box-shadow: 0 1px 0 var(--njm-line);
}
.njm-here {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--njm-r);
  background: var(--njm-main);
  color: var(--njm-main-ink);
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.njm-here:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.njm-or {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--njm-sub);
  font-size: 14px;
}
.njm-or::before, .njm-or::after { content: ""; flex: 1; border-top: 1px dashed var(--njm-line); }
.njm-form { margin: 0; }
.njm-label { display: block; margin-bottom: 8px; font-weight: 700; }
.njm-field { display: flex; gap: 8px; }
.njm .njm-q {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 8px 16px;
  border: 2px solid var(--njm-ink);
  border-radius: var(--njm-r);
  background: var(--njm-paper);
  color: var(--njm-ink);
  font-size: 16px;
  line-height: 1.3;
  box-shadow: none;
}
.njm-go {
  flex: none;
  min-width: 80px;
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid var(--njm-ink);
  border-radius: var(--njm-r);
  background: var(--njm-ink);
  color: #fff;
  font-weight: 700;
}
.njm-privacy, .njm-credit { color: var(--njm-sub); font-size: 14px; }
.njm-credit { margin-top: 16px !important; }
.njm-credit a { color: var(--njm-main); text-decoration: underline; text-underline-offset: 2px; }

.njm-body { margin-top: 24px; }
.njm-body[hidden], .njm-alt[hidden], .njm-more[hidden] { display: none; }
.njm-status { font-weight: 700; min-height: 1.7em; }
.njm.is-busy .njm-status::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid var(--njm-line);
  border-top-color: var(--njm-main);
  border-radius: 50%;
  animation: njm-spin .8s linear infinite;
}
@keyframes njm-spin { to { transform: rotate(360deg); } }

.njm-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--njm-sub); }
.njm-alt-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--njm-line);
  border-radius: 999px;
  background: var(--njm-paper);
  color: var(--njm-ink);
  font-size: 14px;
}

/* 食券機のボタン */
.njm-chips {
  display: flex;
  gap: 8px;
  margin: 16px calc(var(--njm-pad) * -1) 0;
  padding: 0 var(--njm-pad) 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.njm-chips:empty { display: none; }
.njm-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--njm-ink);
  border-radius: var(--njm-r);
  background: var(--njm-paper);
  color: var(--njm-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background-color .15s ease, color .15s ease;
}
.njm-chip[aria-pressed="true"] { background: var(--njm-ink); color: #fff; }
.njm-n {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--njm-wash);
  color: var(--njm-ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.njm-split { display: grid; gap: 16px; margin-top: 16px; }
.njm-map {
  height: 320px;
  border: 2px solid var(--njm-ink);
  border-radius: 12px;
  background: #e8e4da;
  z-index: 0;
}
.njm .njm-list { display: grid; gap: 8px; margin: 0 !important; padding: 0 !important; list-style: none; counter-reset: none; }
.njm .njm-item { margin: 0; padding: 0; list-style: none; }
.njm .njm-item::before, .njm .njm-item::marker { content: none; display: none; }

/* 食券：左の半券に順位、点線で切り取り */
.njm-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  width: 100%;
  min-height: 64px;
  padding: 0;
  border: 1px solid var(--njm-line);
  border-radius: var(--njm-r);
  background: var(--njm-paper);
  color: var(--njm-ink);
  text-align: left;
  transition: border-color .15s ease, transform .15s ease;
}
.njm-row:hover { border-color: var(--njm-ink); }
.njm-row:active { transform: scale(.99); }
.njm-rank {
  display: grid;
  place-items: center;
  border-right: 2px dashed var(--njm-line);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.njm-item:nth-child(-n+3) .njm-rank { color: var(--njm-main); }
.njm-main { display: grid; gap: 4px; padding: 8px 16px; min-width: 0; }
.njm-name { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.njm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.njm-tag {
  padding: 0 8px;
  border-radius: 4px;
  background: var(--njm-main);
  color: var(--njm-main-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}
.njm-src { color: var(--njm-sub); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.njm-more {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 2px dashed var(--njm-ink);
  border-radius: var(--njm-r);
  background: transparent;
  color: var(--njm-ink);
  font-weight: 700;
}

/* 地図の上の印 */
.njm .njm-me span {
  display: block;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1a5fd0;
  box-shadow: 0 0 0 6px rgba(26, 95, 208, .25);
}
.njm .njm-pin span {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.njm .njm-pin span::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--njm-main);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}
.njm .leaflet-popup-content { margin: 16px; font-size: 16px; line-height: 1.4; }
.njm-pop-name, .njm-pop-d, .njm-pop-src { display: block; }
.njm-pop-d { margin-top: 4px; }
.njm-pop-src { margin-top: 8px; color: var(--njm-sub); font-size: 14px; }
.njm .leaflet-control-attribution { font-size: 14px; line-height: 1.3; }
.njm .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }

/* 広い時は地図とリストを横に並べる */
@container (min-width: 560px) {
  .njm-chips { flex-wrap: wrap; overflow: visible; }
}
@container (min-width: 640px) {
  .njm-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .njm-map { height: 520px; }
  .njm-list { max-height: 520px; overflow-y: auto; padding-right: 4px; }
  .njm-ask { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); align-items: end; }
  .njm-or { flex-direction: column; height: 100%; justify-content: center; }
  .njm-or::before, .njm-or::after { border-top: 0; border-left: 1px dashed var(--njm-line); flex: 1; }
  .njm-privacy { grid-column: 1 / -1; }
}
@supports not (container-type: inline-size) {
  @media (min-width: 900px) {
    .njm-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
    .njm-map { height: 520px; }
    .njm-list { max-height: 520px; overflow-y: auto; }
  }
}
@media (min-width: 600px) { .njm { --njm-pad: 32px; padding: 32px var(--njm-pad); } }
@media (prefers-reduced-motion: reduce) {
  .njm *, .njm *::after { transition: none !important; animation-duration: 1.5s !important; }
}
