/* OSの見た目に依存しない、ヨミドコロ共通の選択メニューです。 */
.native-select-hidden {
  display: none !important;
}

.custom-select {
  display: block;
  width: 100%;
  min-width: 0;
}

.select-trigger {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid #b9c2b3;
  border-radius: 4px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.select-trigger:hover {
  border-color: #81927c;
  background: #fbf8ef;
}

.select-trigger-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger .icon {
  width: 16px;
  height: 16px;
  color: #65775f;
  transform: rotate(180deg);
  transition: transform .18s;
}

.custom-select.is-open .select-trigger {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #244e4314;
}

.custom-select.is-open .select-trigger .icon {
  transform: rotate(0);
}

.select-menu {
  position: fixed;
  z-index: 80;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #aeb9a7;
  border-radius: 6px;
  background: #fbf8ef;
  box-shadow: 0 18px 48px #18332a26, 0 3px 10px #18332a14;
}

.select-option {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
}

.select-option:hover,
.select-option:focus-visible {
  outline: 0;
  background: #edf0e5;
}

.select-option[aria-selected="true"] {
  background: #e2e9d9;
  color: var(--green-dark);
}

.select-option-mark {
  display: grid;
  place-items: center;
  opacity: 0;
}

.select-option-mark .icon {
  width: 16px;
  height: 16px;
}

.select-option[aria-selected="true"] .select-option-mark {
  opacity: 1;
}

.select-option:disabled {
  opacity: .45;
}

/* 3D画面でも同じ部品を使い、暗い操作パネルとの境界だけ調整します。 */
.shelf-navigation .select-trigger {
  border-color: #d8d7c266;
  background: #f7f4eb;
  color: #244e43;
  font-size: 12px;
}

/* 入力・ラジオ・折りたたみも、ブラウザ既定の質感を残しません。 */
.shelf-form input:not([type=radio]):hover,
.shelf-form textarea:hover,
.search-label input:hover,
.filters input:hover,
.share-url:hover {
  border-color: #81927c;
}

.shelf-form input:not([type=radio]):focus-visible,
.shelf-form textarea:focus-visible,
.search-label input:focus-visible,
.filters input:focus-visible,
.share-url:focus-visible,
.select-trigger:focus-visible {
  outline: 3px solid #bd743d;
  outline-offset: 3px;
}

.shelf-form textarea {
  resize: none;
}

input[type="search"]::-webkit-search-cancel-button {
  width: 17px;
  height: 17px;
  appearance: none;
  cursor: pointer;
  opacity: .68;
  background:
    linear-gradient(45deg, transparent 46%, var(--green) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--green) 46% 54%, transparent 54%);
}

.radio-label input {
  appearance: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #98a492;
  border-radius: 50%;
  background: #fffdf8;
}

.radio-label input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  transform: scale(0);
  transition: transform .15s;
}

.radio-label input:checked {
  border-color: var(--green);
}

.radio-label input:checked::before {
  transform: scale(1);
}

.radio-label input:focus-visible {
  outline: 3px solid #bd743d;
  outline-offset: 3px;
}

.custom-book summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  text-decoration: none;
}

.custom-book summary::-webkit-details-marker {
  display: none;
}

.custom-book summary::before {
  content: "＋";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #aeb9a7;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}

.custom-book[open] summary::before {
  content: "−";
}

.select-menu,
.picker-results,
.sheet-body {
  scrollbar-color: #9ca995 transparent;
  scrollbar-width: thin;
}

@media (prefers-reduced-motion: reduce) {
  .select-trigger,
  .select-trigger .icon,
  .radio-label input::before {
    transition: none;
  }
}
