html, body {
  margin: 0;
  padding: 0;
  background: #e0e0e0;
  font-family: sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  margin: 24px 0;
  padding: 18px 10px 26px 10px;
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.title-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title-header h1 {
  font-size: 20px;
  margin: 0;
  text-align: left;
  width: 80%;
}

.gear-icon {
  width: 32px;
  height: 32px;
}

.gear-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  width: 15%;
}

.gear-menu {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 160px;
}

.menu-item {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f0f0f0;
}

.place-row {
  width: 100%;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.place-box {
  width: 100%;
  max-width: 300px;
  height: 38px;
  font-size: 15px;
  border-radius: 7px;
  border: 1.5px solid #bbb;
  padding: 6px;
  background: #fafbfc;
  text-align-last: center;
}

.date-row-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 14px 0;
  gap: 10px;
}

.date-arrow-btn {
  background: #e5e5e5;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  width: 36px;
  height: 36px;
}

.date-arrow-btn:active {
  background: #d0d0d0;
}

.date-picker {
  font-size: 17px;
  padding: 6px 10px;
  border: 1.5px solid #bbb;
  border-radius: 7px;
  background: #f7f7f7;
  appearance: none;
  text-align: center;
}

.image-time-outer {
  width: 100%;
  position: relative;
  margin: 0 0 6px 0;
  display: block;
}

.time-control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
}

.image-time {
  font-size: 16px;
  margin: 0;
  text-align: center;
  width: 100px;
  z-index: 1;
  background: transparent;
}

.clock-icon-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 0 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 32px;
  width: 32px;
}

.clock-icon-img {
  width: 28px;
  height: 28px;
  display: block;
}

.camera-change-icon {
  width: 32px;
  height: 32px;
  position: absolute;
  left: 50%;
  transform: translateX(120px);
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
}

.image-cycle {
  font-size: 13px;
  text-align: center;
  margin-top: 2px;
}

.image-viewer-wrapper {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.image-arrow-btn {
  background: #e5e5e5;
  border: none;
  border-radius: 50%;
  font-size: 26px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  margin: 0 7px;
}

.image-viewer {
  flex: 1;
  height: 210px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 28px;
  color: #aaa;
  min-width: 150px;
  max-width: 240px;
}

.arrow-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.arrow-label {
  font-size: 13px;
  color: #444;
}

.close-btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: #0078D4;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
}

/* モーダル関連 */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-inner {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#modalImage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;          /* 🔧 追加：幅を自動で決定 */
  height: auto;         /* 🔧 追加：高さも自動で決定 */
  object-fit: contain;  /* 🔧 追加：画像全体を収め、比率維持 */
  display: block;       /* 🔧 追加：余計な隙間を防ぐ */
}

#modal_close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 101;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.carousel-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.carousel {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
  touch-action: pan-y;
}


.slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%; /* もしくは固定値（例: 400px） */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.temp_message {
  opacity: 0;
  transition: opacity 1s ease;
  background-color: #fff3cd;
  color: red;
  padding: 5px;
  border: 1px solid #fff3cd;
  border-radius: 5px;
  margin-top: 5px;
  display: none;
}
.temp_message.show {
  display: block;
  opacity: 1;
}
.temp_message.fade-out {
  opacity: 0;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
