#instrumentation-search {
  max-width: 900px;
  margin: 20px auto;
  padding: 10px 24px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  font-family: sans-serif;
}

#instrumentation-search h2 {
  margin: 0 0 10px;
  padding: 10px;
  font-size: 20px;
  font-weight: 500;
}

#inst-list {
  min-height: 60px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  background: #fff;
}

#inst-list p {
  margin: 0;
  color: #888;
  font-size: 14px;
}

#inst-list .inst-row {
  display: grid;
  grid-template-areas:
    "inst btn";
  grid-template-columns: auto 50px;

  height: 32px;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #555;
  font-size: 14px;
  padding: 5px;
  margin: 5px;
}

#inst-list #inst-text {
  grid-area: inst;
  text-indent: 10px;
}

#inst-list .edit-btn {
  grid-area: btn;
}

#inst-list .edit,
#inst-list .delete {
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 3px !important;
  background: #fff !important;
  cursor: pointer !important;
  transition: 0.15s !important;
}

#inst-list .edit:hover,
#inst-list .delete:hover {
  background: #ddd !important;
}

#inst-list .edit:hover path,
#inst-list .delete:hover path {
  stroke: #444;
}

.inst-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 4px;
  background: #e6f0ff;
  border: 1px solid #bcd;
  border-radius: 20px;
  font-size: 14px;
}

.inst-item button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.exact-match {
  width: 259px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: none;
  margin: 4px 0 4px 0;
  padding: 6px 12px;
  font-size: 14px;
}

.exact-match-button {
  width: 42px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  transition: 0.2s;
}

.exact-match-button.enabled {
  background: #4caf50;
}

.exact-match-knob {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.1s;
}

.exact-match-button.enabled .exact-match-knob {
  left: 22px;
}

.exact-match-button.disabled .exact-match-knob {
  right: 22px;
}

#instrumentation-search button:not(.exact-match, .display-edit) {
  width: 259px;
  margin: 4px 0 4px 0;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: 0.15s;
}

#instrumentation-search select {
  width: 259px;
  margin: 4px 0 4px 0;
  padding: 6px 12px;
  font-size: 14px;
}

#instrumentation-search button:hover {
  background: #f0f0f0;
}

#instrumentation-search button#search-btn {
  width: 100%;
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
  margin-top: 20px;
}

#instrumentation-search button#search-btn:hover {
  background: #0052a3;
}

.back-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.4);

  display: none;
  /* 初期は非表示 */
  align-items: center;
  justify-content: center;

  z-index: 1000;
}

.back-screen.active {
  display: flex;
}

#input-window,
#edit-window {
  width: 360px;
  max-width: 90%;
  padding: 20px;
  margin: 20px auto;

  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

  display: flex;
  flex-direction: column;

  animation: fadeInScale 0.2s ease;

  position: relative;
}

#input-title,
#edit-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

#input-window label,
#edit-window label {
  font-size: 13px;
  color: #555;
  margin-top: 10px;
}

#input-window select,
#input-window input[type="number"],
#edit-window select,
#edit-window input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;

  border: 1px solid #ccc;
  border-radius: 6px;
}

/* 行グループ（チェック＋入力を横並びに） */
.input-row,
.edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
}

/* チェックボックスを隠す */
#input-window input[type="checkbox"],
#edit-window input[type="checkbox"] {
  display: none;
}

/* 見た目 */
.checkbox-ui {
  width: 18px;
  height: 18px;
  border: 1px solid #888;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: 0.15s;
  border: 1px solid #ccc;
}

.checkbox-ui.disabled {
  cursor: default;
  background: #eee;
}

/* チェック時 */
#input-window input[type="checkbox"]:checked+.checkbox-ui,
#edit-window input[type="checkbox"]:checked+.checkbox-ui {
  background: #007bff;
  border-color: #007bff;
}

/* チェックマーク */
.checkbox-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

/* チェック時表示 */
#input-window input[type="checkbox"]:checked+.checkbox-ui::after,
#edit-window input[type="checkbox"]:checked+.checkbox-ui::after {
  opacity: 1;
}

/* ボタン共通 */
#input-window button,
#edit-window button {
  margin-top: 8px;
  padding: 8px;
  font-size: 14px;

  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* 追加ボタン */
#input-window button:first-of-type,
#edit-window button:first-of-type {
  background: #0066cc;
  color: #fff;
  margin-top: 30px;
}

#input-window button:first-of-type:hover,
#edit-window button:first-of-type:hover {
  background: #0052a3;
}

#input-window button:first-of-type:disabled,
#edit-window button:first-of-type:disabled {
  background: #888;
  cursor: default;
}

/* 閉じるボタン（右上） */
#input-window button:last-of-type,
#edit-window button:last-of-type {
  position: absolute;
  top: 10px;
  right: 12px;

  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;

  background: transparent;

  border: 1px solid #aaa;
  border-radius: 4px;
}

#input-window button:last-of-type:hover,
#edit-window button:last-of-type:hover {
  background: #f0f0f0;
}

#input-window button:last-of-type:hover path,
#edit-window button:last-of-type:hover path {
  stroke: #666;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}










/* レスポンシブ */
@media (max-width: 600px) {
  #instrumentation-search {
    padding: 16px;
    margin: 10px;
  }

  #instrumentation-search button,
  #instrumentation-search select {
    width: 100%;
    margin: 4px 0;
  }

  .exact-match {
    justify-content: space-between;
  }

  #instrumentation-search button:not(.exact-match),
  #instrumentation-search select {
    width: 100%;
  }
}