.history-form-area,
.history-list-area,
.history-detail-area {
  margin-bottom: 80px;
}

.history-form {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 28px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
}

.history-field {
  margin-bottom: 18px;
}

.history-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.history-error {
  margin: 8px 0 0;
  color: #e23d29;
  font-size: 14px;
  font-weight: 600;
}

.history-form .btn-complaint {
  border-radius: 10px;
  font-weight: 700;
  padding: 12px 22px;
}

.history-add-link {
  margin-bottom: 24px;
  text-align: right;
}

.history-card {
  margin-bottom: 24px;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
}

.history-card img,
.history-detail > img {
  display: block;
  width: 100%;
  aspect-ratio: 1.6 / 1;
  object-fit: cover;
}

.history-card-body {
  padding: 12px 14px 16px;
}

.history-card h2,
.history-detail h2 {
  margin: 0 0 8px;
  color: #141414;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
}

.history-card a {
  color: inherit;
  text-decoration: none;
}

.history-card a:hover h2 {
  color: #e23d29;
}

.history-card p,
.history-empty {
  margin: 0;
  color: #444;
}

.history-detail {
  width: min(860px, 100%);
  margin: 0 auto 56px;
}

.history-detail > img {
  height: auto;
  margin: 12px 0 20px;
  border-radius: 10px;
  aspect-ratio: auto;
  max-height: 460px;
  object-fit: contain;
  background: #f6f6f6;
}

.history-content {
  color: #262626;
  font-size: 18px;
  line-height: 1.7;
}

.history-content p,
.history-content ul,
.history-content ol,
.history-content table,
.history-content blockquote {
  margin: 0 0 1em;
}

.history-content ul,
.history-content ol {
  padding-left: 1.4em;
}

.history-content table {
  width: 100%;
  border-collapse: collapse;
}

.history-content td,
.history-content th {
  padding: 8px;
  border: 1px solid #ddd;
}

.history-content img {
  max-width: 100%;
  height: auto;
}

.history-content blockquote {
  padding-left: 12px;
  border-left: 3px solid #e23d29;
}

.history-source {
  margin-top: 8px;
  font-size: 16px;
}

.history-source span {
  color: #e23d29;
  font-weight: 700;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  min-height: 640px;
  margin: 12px 0 16px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #f6f6f6;
}

.pdf-loading {
  margin: 0 0 8px;
  color: #444;
  font-weight: 600;
}

.bg-gallery,
.bg-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}

.bg-gallery figure,
.bg-preview li {
  margin: 0;
}

.bg-gallery img,
.bg-preview img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  background: #f6f6f6;
}

.image-caption {
  margin: 8px 0 0;
  color: #141414;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.bg-caption-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 700;
}

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

.record-actions form {
  margin: 0;
}

.btn-delete {
  border: 1px solid #e23d29;
  border-radius: 10px;
  background: #fff;
  color: #e23d29;
  font-weight: 700;
  padding: 12px 22px;
}

.btn-delete:hover {
  background: #e23d29;
  color: #fff;
}

.image-row {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 10px;
}

.image-row img {
  display: block;
  width: min(280px, 100%);
  height: 160px;
  margin-bottom: 10px;
  object-fit: cover;
  border-radius: 8px;
}

.image-row label {
  display: block;
  margin: 8px 0 4px;
  font-weight: 700;
}

.btn-add-image {
  margin-top: 4px;
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.figure-card {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
}

.figure-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.figure-card img,
.figure-card-fallback {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  min-height: 360px;
  object-fit: cover;
  object-position: center top;
  background: linear-gradient(135deg, #f3f3f3, #e8e8e8);
}

.figure-card-body {
  padding: 18px 16px 22px;
  text-align: center;
}

.figure-card-body h2 {
  margin: 0;
  color: #141414;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
}

.figure-card-link:hover h2 {
  color: #e23d29;
}

.figure-edit-preview {
  display: block;
  width: min(280px, 100%);
  height: 180px;
  margin: 0 0 10px;
  object-fit: cover;
  border-radius: 8px;
  background: #f6f6f6;
}

.pdf-row {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 10px;
}

.pdf-row label {
  display: block;
  margin: 8px 0 4px;
  font-weight: 700;
}

.pdf-existing-name {
  margin: 0 0 8px;
  font-weight: 700;
}

.pdf-existing-name a {
  color: #e23d29;
  text-decoration: none;
}

.pdf-existing-name a:hover {
  text-decoration: underline;
}

.war-pdf-list {
  margin: 24px 0 8px;
}

.war-pdf-block {
  margin: 0 0 28px;
}

.war-pdf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.war-pdf-head h3 {
  margin: 0;
  color: #141414;
  font-size: 20px;
  font-weight: 800;
}

.war-pdf-head .btn-complaint {
  border-radius: 10px;
  font-weight: 700;
  padding: 10px 18px;
}

.place-card {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
}

.place-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.place-card img,
.place-card-fallback {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: linear-gradient(135deg, #f3f3f3, #e8e8e8);
}

.place-card-body {
  padding: 16px 18px 20px;
}

.place-card-body h2 {
  margin: 0 0 6px;
  color: #141414;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}

.place-card-body p {
  margin: 0;
  color: #555;
  font-size: 15px;
  line-height: 1.5;
}

.place-card-link:hover h2 {
  color: #e23d29;
}

.place-block {
  margin: 0 0 16px;
}

.place-block h3 {
  margin: 0 0 6px;
  color: #e23d29;
  font-size: 18px;
  font-weight: 800;
}

.place-block p {
  margin: 0;
  white-space: pre-line;
}

.bg-hint {
  margin: 8px 0 0;
  color: #666;
  font-size: 14px;
}

@media (max-width: 767px) {
  .pdf-frame {
    min-height: 480px;
  }

  .bg-gallery img,
  .bg-preview img {
    height: 180px;
  }

  .place-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .place-card img,
  .place-card-fallback {
    height: 200px;
  }

  .figure-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .figure-card img,
  .figure-card-fallback {
    min-height: 320px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .figure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-card img,
  .figure-card-fallback {
    min-height: 340px;
  }
}

[x-cloak] {
  display: none !important;
}
