:root {
  --color-header: #2D5A27;
  --color-amber: #EF9F27;
  --color-bg: #F5F3EE;
  --color-text: #222222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

.site-header {
  background: var(--color-header);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-header__logo {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
}

.pwa-install-icon-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 8px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.pwa-install-icon-button[hidden] {
  display: none;
}

.pwa-install-icon-button__icon {
  display: block;
  border-radius: 8px;
}

.pwa-install-icon-button__label {
  color: #fff;
}

.site-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.site-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 16px;
}

.footer-contact {
  text-align: center;
  margin-top: 20px;
}

.footer-contact__link {
  display: inline-block;
}

.footer-contact__note {
  text-align: center;
  font-size: 14px;
  color: #5F6B58;
  margin-top: 6px;
}

.footer-contact__ext {
  font-size: 0.85em;
}

.button {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 24px;
  margin: 8px 4px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  text-align: center;
}

.button--primary {
  background: var(--color-header);
  color: #fff;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: bold;
}

.badge--open {
  background: var(--color-amber);
  color: #222;
}

.badge--confirmed {
  background: var(--color-header);
  color: #fff;
}

.artifact-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.artifact-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.artifact-card a {
  display: block;
  padding: 8px;
  color: inherit;
  text-decoration: none;
}

.artifact-card img,
.artifact-card__noimage {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.artifact-card__no {
  font-weight: bold;
  margin: 8px 0 0;
}

.artifact-card__type {
  margin: 4px 0;
  overflow-wrap: break-word;
}

.tag-chip-list {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-header);
  color: var(--color-header);
  font-size: 14px;
  overflow-wrap: break-word;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-clear-top {
  margin: 0 0 12px;
}

.filter-clear-top__link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.filter-form select,
.filter-form input[type="search"] {
  min-height: 44px;
  font-size: 16px;
  padding: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.count-bar {
  font-weight: bold;
  margin-bottom: 12px;
}

.artifact-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 16px;
}

.artifact-nav__disabled {
  color: #999;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.photo-gallery img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.photo-gallery__thumb {
  padding: 0;
  border: none;
  background: none;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox__toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  flex-wrap: wrap;
}

.photo-lightbox__toolbar .button {
  min-height: 44px;
  min-width: 44px;
  background: #fff;
}

.photo-lightbox__viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.photo-lightbox__viewport img {
  max-width: 90%;
  max-height: 90%;
  transition: transform 0.15s ease;
}

.artifact-info {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.artifact-info th,
.artifact-info td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #ddd;
  font-size: 16px;
  overflow-wrap: break-word;
}

.artifact-info th {
  width: 35%;
  color: #555;
  font-weight: normal;
}

.button--secondary {
  background: #fff;
  color: var(--color-header);
  border: 1px solid var(--color-header);
}

/* 公開画面用ヘルプポップアップ（?ボタン）：管理画面の.help-tip/.help-modalとは独立した部品 */
.pub-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  margin-left: 6px;
  padding: 0;
  border: 1.5px solid var(--color-header);
  border-radius: 50%;
  background: #fff;
  color: var(--color-header);
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.pub-help-tip:hover,
.pub-help-tip:focus {
  background: var(--color-header);
  color: #fff;
}

.pub-help-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.pub-help-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 47, 0.55);
}

.pub-help-modal__box {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.pub-help-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--color-header);
}

.pub-help-modal__text {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
}

.pub-help-modal__close {
  display: block;
  margin: 0 0 0 auto;
}

.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.pwa-install-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 47, 0.55);
}

.pwa-install-modal__box {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.pwa-install-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--color-header);
}

.pwa-install-modal__text {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
}

.pwa-install-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwa-install-modal__actions .button {
  margin: 0;
  width: 100%;
}

.login-page,
.password-change-page {
  max-width: 400px;
  margin: 0 auto;
  padding: 24px 16px;
}

.login-page form,
.password-change-page form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-page label,
.password-change-page label {
  margin-top: 12px;
  font-weight: bold;
}

.login-page input,
.password-change-page input {
  min-height: 44px;
  font-size: 16px;
  padding: 8px;
}

.form-error {
  color: #B3261E;
  font-weight: bold;
}

.form-notice {
  color: var(--color-header);
  font-weight: bold;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  float: right;
  color: #fff;
}

.admin-nav__logout {
  margin: 0;
}

.step-indicator {
  font-weight: bold;
  margin-bottom: 12px;
}

.submit-step {
  border: none;
  padding: 0;
  margin: 0 0 24px;
  padding-bottom: 84px;
}

.submit-step__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 16px -16px -16px;
  background: var(--color-bg);
  border-top: 1px solid #d8d3c8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.submit-step__actions .button {
  flex: 1;
  margin: 0;
}

.submit-page label {
  display: block;
  margin-top: 16px;
  font-weight: bold;
}

.submit-page input[type="text"],
.submit-page textarea {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 8px;
  font-family: inherit;
}

.submit-page textarea {
  min-height: 88px;
}

.field-hint {
  color: #555;
  margin: 4px 0;
  font-size: 16px;
}

.step-purpose {
  color: var(--color-header);
  margin: 8px 0 16px;
  font-size: 16px;
  font-weight: bold;
}

.required-mark {
  color: #B3261E;
  font-weight: normal;
  font-size: 14px;
}

.optional-mark {
  color: #777;
  font-weight: normal;
  font-size: 14px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  font-weight: normal;
}

.field-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

.map-placeholder {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #555;
  margin-top: 8px;
}

.map-explainer {
  font-weight: bold;
  margin: 8px 0;
}

.map-canvas {
  width: 100%;
  height: 320px;
  border-radius: 8px;
  margin-top: 8px;
}

.map-canvas[hidden] {
  display: none;
}

.map-jump-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.map-jump-buttons[hidden] {
  display: none;
}

.map-jump-button {
  flex: 1 1 30%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid var(--color-header);
  background: #fff;
  color: var(--color-header);
  text-align: center;
}

.geocode-search {
  margin: 8px 0;
}

.geocode-search label {
  display: block;
  font-weight: bold;
}

.geocode-search input[type="search"] {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 8px;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.geocode-search[hidden] {
  display: none;
}

.review-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-weight: bold;
}

.review-tabs a {
  color: inherit;
}

.review-tabs__active {
  text-decoration: underline;
  color: var(--color-header);
}

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-list__item {
  background: #fff;
  border-radius: 8px;
}

.review-list__item a {
  display: block;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.review-list__no {
  font-weight: bold;
  margin-right: 8px;
}

.review-list__date {
  color: #555;
  margin-left: 8px;
}

.review-list__site {
  margin: 4px 0 0;
}

.review-submission {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.import-menu {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-menu li {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.import-warning {
  color: #b00020;
  font-weight: bold;
}

.import-errors,
.import-list {
  background: #fff;
  border-radius: 8px;
  padding: 12px 12px 12px 32px;
  margin: 8px 0;
}

.review-confirm-form label {
  display: block;
  margin-top: 16px;
  font-weight: bold;
}

.review-confirm-form input[type="text"],
.review-confirm-form textarea {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 8px;
  font-family: inherit;
}

.review-confirm-form textarea {
  min-height: 88px;
}

#map-clear-pin {
  display: block;
  width: 100%;
  margin: 12px 0 0;
}

#map-clear-pin[hidden] {
  display: none;
}

/* ==========================================================================
   遺物一覧（PC幅レイアウト）
   スマホ幅では .list-page__pc は非表示のままとし、
   従来のスマホ用マークアップ（.list-page__mobile）のみを表示する。
   ========================================================================== */

.list-page__pc {
  display: none;
}

@media (min-width: 900px) {
  .list-page__mobile {
    display: none;
  }

  .list-page__pc {
    display: block;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 32px clamp(24px, 5vw, 72px) 64px;
  }

  .list-pc__topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
  }

  .list-pc__title {
    margin: 0;
    font-size: 30px;
    color: var(--color-header);
  }

  .list-pc__admin-link {
    color: #777;
    font-size: 14px;
    text-decoration: none;
  }

  .list-pc__admin-link:hover {
    text-decoration: underline;
  }

  .list-pc__filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
  }

  .list-pc__filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
  }

  .list-pc__filter-field--search {
    flex: 1 1 260px;
  }

  .list-pc__filter-field label {
    font-weight: bold;
    font-size: 16px;
  }

  .list-pc__filter-field select,
  .list-pc__filter-field input[type="search"] {
    min-height: 48px;
    font-size: 17px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
  }

  .list-pc__filter-checkbox {
    font-size: 17px;
  }

  .list-pc__filter-submit {
    font-size: 17px;
    padding: 12px 32px;
  }

  .list-pc__filter-clear {
    font-size: 17px;
    padding: 12px 24px;
  }

  .list-pc__count-bar {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .list-pc__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
  }

  .list-pc__card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
  }

  .list-pc__card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }

  .list-pc__card a {
    display: block;
    color: inherit;
    text-decoration: none;
  }

  .list-pc__card img,
  .list-pc__card-noimage {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
  }

  .list-pc__card-body {
    padding: 16px;
  }

  .list-pc__card-no {
    font-weight: bold;
    font-size: 20px;
    margin: 0 0 6px;
  }

  .list-pc__card-type {
    font-size: 17px;
    margin: 0 0 8px;
    overflow-wrap: break-word;
  }

  .list-pc__empty {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    font-size: 18px;
  }
}

/* ==========================================================================
   遺物詳細（PC幅レイアウト）
   スマホ幅では .detail-page__pc は非表示のままとし、
   従来のスマホ用マークアップ（.detail-page__mobile）のみを表示する。
   ========================================================================== */

.detail-page__pc {
  display: none;
}

@media (min-width: 900px) {
  .detail-page__mobile {
    display: none;
  }

  .detail-page__pc {
    display: block;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 32px clamp(24px, 5vw, 72px) 64px;
  }

  .detail-pc__topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
  }

  .detail-pc__title {
    margin: 0;
    font-size: 30px;
    color: var(--color-header);
  }

  .detail-pc__admin-link {
    color: #777;
    font-size: 14px;
    text-decoration: none;
  }

  .detail-pc__admin-link:hover {
    text-decoration: underline;
  }

  .detail-pc__nav {
    max-width: 480px;
    font-size: 18px;
    margin-bottom: 24px;
  }

  .detail-pc__layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(380px, 1fr);
    gap: 32px;
    align-items: start;
  }

  .detail-pc__photos,
  .detail-pc__info {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
  }

  .detail-pc__gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 0;
  }

  .detail-pc__noimage {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 40px 0;
    margin: 0;
  }

  .detail-pc__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
  }

  .detail-pc__cta {
    font-size: 18px;
    padding: 14px 32px;
    margin: 0;
  }

  .detail-pc__table {
    margin: 0;
  }

  .detail-pc__table th,
  .detail-pc__table td {
    font-size: 17px;
    padding: 12px 8px;
  }

  .detail-pc__table th {
    width: 32%;
  }
}

/* ==========================================================================
   表採情報の入力フォーム（PC幅の見やすさ調整のみ）
   スマホ幅（900px未満）の表示・操作フロー（3ステップ・地図・送信）は
   一切変更しない。900px以上でも同一マークアップのまま、
   現在表示中のステップをカード状に大きく見せるCSSのみを適用する。
   ========================================================================== */

.submit-pc__admin-link {
  display: none;
}

@media (min-width: 900px) {
  .submit-page {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 40px clamp(24px, 5vw, 72px) 64px;
  }

  .submit-page__topbar,
  .submit-page > p,
  .submit-page form {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
  }

  .submit-page__topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .submit-page h1 {
    font-size: 28px;
    color: var(--color-header);
  }

  .submit-pc__admin-link {
    display: inline-block;
    color: #777;
    font-size: 14px;
    text-decoration: none;
  }

  .submit-pc__admin-link:hover {
    text-decoration: underline;
  }

  .submit-page > p {
    font-size: 18px;
  }

  #step-indicator {
    font-size: 18px;
  }

  .submit-step {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 40px 48px;
    margin: 0 0 32px;
  }

  .submit-step legend {
    padding: 0;
    font-size: 22px;
    font-weight: bold;
    color: var(--color-header);
    margin-bottom: 16px;
  }

  .submit-page label {
    font-size: 18px;
    margin-top: 20px;
  }

  .field-hint {
    font-size: 16px;
  }

  .submit-page input[type="text"],
  .submit-page textarea {
    font-size: 18px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #bbb;
    border-radius: 8px;
  }

  .submit-page textarea {
    min-height: 130px;
  }

  .radio-label {
    font-size: 18px;
    min-height: 52px;
    gap: 12px;
  }

  .map-jump-button {
    font-size: 18px;
  }

  .map-explainer {
    font-size: 18px;
  }

  .map-placeholder {
    font-size: 18px;
    padding: 32px;
  }

  .map-canvas {
    height: 460px;
  }

  #map-clear-pin {
    font-size: 17px;
  }

  .submit-step .button {
    font-size: 18px;
    min-height: 52px;
    padding: 14px 32px;
  }

  .submit-step__actions {
    position: static;
    display: block;
    gap: 0;
    margin: 24px 0 0;
    padding: 0;
    background: none;
    border-top: none;
    box-shadow: none;
  }

  .submit-step__actions .button {
    flex: none;
  }
}

/* ==========================================================================
   評価アンケートボタン（EVALUATION_SURVEY_ENABLED時のみ表示。管理画面・公開画面共通。
   主要な操作ボタンより目立たせないよう、グレー系の控えめな配色にする） */
.survey-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
}

.survey-buttons__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #B8B8B8;
  border-radius: 999px;
  background: #F4F4F4;
  color: #555555;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  line-height: 1.4;
}

.survey-buttons__link:hover,
.survey-buttons__link:focus-visible {
  background: #E8E8E8;
  color: #333333;
}
