#documents_sheet-container {
  margin-top: 260px;
  padding-bottom: 100px;
  width: 100%;
  overflow-wrap: break-word;
}

#documents_sheet-container #documents_sheet_label {
  justify-self: center;
  font-weight: bold;
  font-size: 25px;
}

#documents_sheet-container .tab-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  padding: 0 10px;
}

#documents_sheet-container .tab-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* 白い半透明の線 */
  background: rgba(255, 255, 255, 0.3);
  /* うっすら白い半透明 */
  backdrop-filter: blur(5px);
  /* 背景を少しぼかすとおしゃれ */
  border-radius: 20px;
  /* 雫に合わせた丸み */
  color: #555;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

#documents_sheet-container .tab-btn.active {
  background: rgba(255, 255, 255, 0.8);
  /* 選択中は白を濃く */
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* 軽く浮かせる */
  font-weight: bold;
}

/* 日付ラベルのスタイル */
#documents_sheet-container .documents_date {
  width: 90%;
  text-align: left;
  /* 左寄せ */
  font-weight: bold;
  font-size: 1.3rem;
  margin: 24px 0 10px 10px;
  /* 余白調整 */
  color: #333;
}

/* 画像が並ぶエリアのスタイル */
#documents_sheet-container .documents_grid {
  display: flex;
  flex-wrap: wrap;
  /* 折り返しを許可 */
  gap: 8px;
  /* 画像同士の隙間 */
  padding: 0 10px;
  margin-bottom: 20px;
}

/* ギャラリーのサムネイル画像 */
#documents_sheet-container .gallery_thumb {
  /* 1行に3枚並べる場合 (100% / 4 = 25%) */
  width: calc(33.333% - 8px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;

  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

#documents_sheet-container #documents_gallery {
  user-select: none;
}

#documents_sheet-container .gallery_thumb:hover {
  opacity: 0.8;
}

#documents_sheet-container .gallery_thumb:active {
  transform: scale(0.95);
  /* タップした時に少し沈む演出 */
}

#documents_sheet-container .gallery_thumb.selected {
  outline: 4px solid #007bff;
  outline-offset: -4px;
  opacity: 0.7;
}

/* モーダル本体 */
#overlay-root #documents_upload_modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  /* 背景を少しぼかすと高級感が出る */
  padding: 30px 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 30px rgba(148, 170, 255, 0.2);
  width: 85%;
  max-width: 350px;
  z-index: 1001;
  border: 1px solid rgba(148, 170, 255, 0.2);
}

/* 入力要素のラベル（任意で追加する場合） */
#overlay-root .modal-label {
  font-size: 14px;
  color: #777;
  align-self: flex-start;
  margin-bottom: -15px;
  margin-left: 5px;
}

/* ファイル入力と日付入力の共通スタイル */
#overlay-root #documents_upload_modal input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 2px solid rgba(220, 225, 235, 1);
  border-radius: 8px;
  font-size: 16px;
  color: #555;
  background: white;
  outline: none;
  transition: border-color 0.2s ease;
}

#overlay-root #documents_upload_modal input:focus {
  border-color: rgba(148, 170, 255, 1);
}

/* 追加ボタン（既存の.selection-btnを流用するか、専用に設定） */
#overlay-root #uploadButton {
  width: 100%;
  border: none;
  color: white;
  background-color: rgba(148, 170, 255, 1);
  /* ここはメインボタンなので色を反転 */
  font-size: 20px;
  font-weight: bold;
  padding: 12px 0;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(148, 170, 255, 0.3);
  cursor: pointer;
  margin-top: 10px;
}

#overlay-rootr #uploadButton:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(148, 170, 255, 0.2);
}

/* ファイル選択ボタンの見た目を少し調整 */
#overlay-root #fileInput::file-selector-button {
  background: rgba(220, 225, 235, 0.5);
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  margin-right: 10px;
  color: #5a6b8a;
  cursor: pointer;
}

/* 追加ボタン：下部中央固定 */
#documents_sheet-container #documents_addButton {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  border: none;
  font-size: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  cursor: pointer;
}

/* 実行バー：下部固定の横長バー */
#documents_sheet-container #selection_bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(220, 225, 235, 1);
  padding: 15px 15px 30px 15px;
  /* 下側に少し余裕を持たせるとモダン */
  display: flex;
  flex-direction: column;
  /* 縦に並べる */
  align-items: center;
  gap: 15px;
  /* 件数とボタンの間の溝 */
  z-index: 1000;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

#documents_sheet-container #selection_count {
  font-size: 18px;
  font-weight: bold;
  color: #5a6b8a;
  /* 背景に合わせた少し濃いめの青灰色 */
}

#documents_sheet-container .selection_button_container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

#documents_sheet-container .selection-btn {
  flex: 1;
  /* 横幅を均等に分ける */
  width: 80%;
  max-width: 250px;
  /* 最大幅を制限 */
  border: none;
  color: rgba(148, 170, 255, 1);
  background-color: white;
  font-size: 18px;
  padding: 12px 0;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(148, 170, 255, 0.2);
  cursor: pointer;
  white-space: nowrap;
  /* 文字を折り返さない */
}

#documents_sheet-container .selection-btn:hover {
  color: white;
  background-color: rgba(148, 170, 255, 1);
  box-shadow: 0 4px 12px rgba(148, 170, 255, 0.4);
  transform: translateY(-2px);
}

#documents_sheet-container .selection-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(148, 170, 255, 0.3);
  background-color: rgba(120, 140, 230, 1);
}

/* PC: 5分割 (幅768px以上で適用) */
@media (min-width: 768px) {
  #documents_sheet-container .gallery_thumb {
    width: calc(20% - 8px);
  }

  #documents_sheet-container .documents_date {
    font-size: 1.5rem;
    margin-left: 15px;
  }
}