:root {
  --ink: #1d1a17;
  --muted: #5b524a;
  --accent: #3b6e5c;
  --accent-dark: #27483d;
  --warm: #d47b3f;
  --card: #ffffff;
  --stroke: #e1d4c4;
  --shadow: 0 18px 32px rgba(40, 33, 25, 0.18);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Space Grotesk", sans-serif;
  color: var(--ink);
  background: #e5e5e5;
}

body.is-modal-open {
  overflow: hidden;
}

.doc-page {
  min-height: 100vh;
  padding: 32px 20px;
  background:
    radial-gradient(circle at top right, rgba(212, 123, 63, 0.2), transparent 30%),
    radial-gradient(circle at bottom left, rgba(59, 110, 92, 0.18), transparent 28%),
    #ece6dd;
}

.doc-card {
  width: min(760px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  line-height: 1.8;
}

.doc-card h1,
.doc-card h2 {
  margin-top: 0;
}

.doc-card h2 {
  margin-top: 24px;
  font-size: 18px;
}

.doc-back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.contact-form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.form-field {
  display: grid;
  gap: 10px;
}

.form-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.form-input,
.form-textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fbf8f3;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 16px 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(59, 110, 92, 0.7);
  box-shadow: 0 0 0 4px rgba(59, 110, 92, 0.14);
  background: #fff;
}

.form-textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.8;
}

.form-box {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(59, 110, 92, 0.18);
  background: linear-gradient(180deg, rgba(59, 110, 92, 0.08), rgba(255, 255, 255, 0.5));
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  cursor: pointer;
}

.form-check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-submit {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--accent-dark);
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 16px 24px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 16px 32px rgba(39, 72, 61, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-submit:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(39, 72, 61, 0.24);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-submit--link {
  width: fit-content;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 26, 23, 0.45);
  backdrop-filter: blur(5px);
}

.confirm-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  border-radius: 26px;
  border: 1px solid rgba(225, 212, 196, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 32px 64px rgba(40, 33, 25, 0.32);
  padding: 28px 26px 24px;
}

.confirm-modal__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.confirm-modal__title {
  margin: 0;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.35;
  color: var(--ink);
}

.confirm-summary {
  margin: 22px 0 0;
  display: grid;
  gap: 14px;
}

.confirm-summary__row {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fbf8f3;
  border: 1px solid var(--stroke);
}

.confirm-summary__row dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.confirm-summary__row dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.confirm-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.confirm-button {
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 20px;
  cursor: pointer;
}

.confirm-button--ghost {
  background: #f2ece4;
  color: var(--ink);
}

.confirm-button--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 32px rgba(39, 72, 61, 0.18);
}

.submit-result {
  border-radius: 16px;
  padding: 16px 18px;
  margin: 20px 0 24px;
  line-height: 1.8;
  font-size: 14px;
}

.submit-result.is-success {
  background: rgba(59, 110, 92, 0.1);
  border: 1px solid rgba(59, 110, 92, 0.3);
  color: var(--accent-dark);
}

.submit-result.is-error {
  background: rgba(214, 69, 59, 0.08);
  border: 1px solid rgba(214, 69, 59, 0.22);
  color: #8a2d27;
}

.page {
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.page::before {
  content: "";
  position: absolute;
  inset: -120px -160px auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(212, 123, 63, 0.24), transparent 70%);
  z-index: 0;
}

.page::after {
  content: "";
  position: absolute;
  left: -140px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(59, 110, 92, 0.24), transparent 70%);
  z-index: 0;
}

.hero,
.main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(245, 245, 245, 0.95);
  border-bottom: 1px solid var(--stroke);
  animation: fadeUp 0.6s ease both;
  position: sticky;
  top: 0;
  z-index: 5;
}

.status {
  padding: 8px 24px;
  background: #f1f1f1;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--muted);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 28px 24px 18px;
}

.hero-copy__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(59, 110, 92, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.hero-copy__close:hover {
  background: #fff;
}

.hero-copy__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.hero-copy h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.14;
  color: #1f1a14;
}

.hero-copy__lead {
  margin: 14px 0 0;
  max-width: 860px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
  font-weight: 600;
}

.brand__title {
  font-size: 15px;
}

.brand__badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 110, 92, 0.14);
  color: var(--accent-dark);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.search input {
  min-width: 240px;
  max-width: 420px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fbf8f3;
  font-size: 14px;
  font-family: inherit;
}

.btn {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

.btn.ghost {
  background: #f4eee6;
  color: var(--accent-dark);
  border-color: var(--stroke);
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: stretch;
}

.map-panel {
  height: calc(100vh - 104px);
  min-height: 520px;
}

.leaflet-popup-content {
  margin: 10px 12px;
}

.leaflet-popup-content .radius-popup {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.leaflet-popup-content .radius-row {
  display: grid;
  grid-template-columns: 44px 90px 24px auto;
  align-items: center;
  gap: 8px;
}

.leaflet-popup-content .radius-label {
  font-weight: 700;
}

.leaflet-popup-content .radius-input {
  width: 90px;
  padding: 4px 6px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
}

.leaflet-popup-content .color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  background: var(--dot);
  cursor: pointer;
  padding: 0;
}

.leaflet-popup-content .color-dot.is-active {
  box-shadow: 0 0 0 2px rgba(31, 111, 85, 0.5);
}

.leaflet-popup-content .color-dot--toggle {
  margin-right: 0;
}

.leaflet-popup-content .radius-unit {
  font-size: 12px;
  color: var(--muted);
}

.leaflet-popup-content .radius-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.leaflet-popup-content .radius-btn {
  background: #ececec;
  border: 1px solid #bfbfbf;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.leaflet-popup-content .radius-btn--danger {
  background: #e7c3c3;
  border-color: #b88f8f;
  color: #5d1c1c;
}


.map-placeholder {
  position: relative;
  height: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.manual-ad {
  border-radius: 20px;
  border: 1px solid rgba(225, 212, 196, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.manual-ad__label {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.manual-ad__slot {
  padding: 12px 16px 16px;
}

.manual-ad--side {
  align-self: start;
  position: sticky;
  top: 92px;
}

.manual-ad--bottom {
  margin: 18px 20px 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  z-index: 2000;
  padding: 24px;
}

.modal.is-hidden {
  display: none;
}

.modal__content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal__header h2 {
  margin: 0;
  font-size: 18px;
}

.icon-btn {
  background: #f4eee6;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
}

.modal__content ol {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal__body,
.modal__list {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal__list {
  padding-left: 18px;
}

.modal__note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.results-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.result-item {
  text-align: left;
  background: #f7f4ef;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.result-item:hover {
  background: #efe7dc;
}

.site-tools {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(29, 26, 23, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.chip-btn--link {
  display: inline-flex;
  align-items: center;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@media (max-width: 980px) {
  .map-shell {
    grid-template-columns: 1fr;
  }

  .manual-ad--side {
    display: none;
  }

  .map-panel {
    height: calc(100vh - 150px);
  }
}

@media (max-width: 680px) {
  .page {
    display: flex;
    flex-direction: column;
    /* モバイルではページ全体を画面いっぱいに */
    height: 100vh;
    overflow: hidden;
  }

  .topbar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    background: transparent;
    border-bottom: none;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    z-index: 1000;
    /* Leafletより上にする */
    pointer-events: none;
    /* 下の地図を触れるように */
  }

  .brand,
  .status {
    display: none;
    /* モバイルではタイトルとステータスを隠してスッキリさせる */
  }

  .search {
    pointer-events: auto;
    /* 検索ボックスは触れるように */
    background: rgba(255, 255, 255, 0.96);
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  .search input {
    max-width: none;
    background: #f4f4f5;
    border: 1px solid transparent;
    font-size: 16px;
    /* iOSでズームしないサイズ */
    height: 48px;
  }

  .search input:focus {
    background: #fff;
    border-color: var(--accent);
  }

  /* ボタンを横並びにするラッパーがあれば良いが、一旦Flexで調整 */
  .search button {
    height: 44px;
  }

  /* 検索内のボタン配置を調整（もしボタンが横並びなら） */
  .search {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
  }

  .search input {
    grid-column: 1 / -1;
  }

  .btn {
    width: 100%;
  }

  /* 地図を画面いっぱいに */
  .map-panel {
    position: absolute;
    inset: 0;
    height: 100% !important;
    z-index: 1;
    min-height: auto;
  }

  .manual-ad--bottom {
    margin: 0 16px 88px;
    position: relative;
    z-index: 3;
  }

  /* 検索結果などを下から出す場合の調整 */
  .results-list {
    max-height: 40vh;
    overflow-y: auto;
  }

  .site-tools {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: stretch;
  }

  .chip-btn,
  .chip-btn--link {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
  }
}
