/*
 * HAKARU SHARED INSTRUMENT SELECTOR V3
 * One visual component for 練習 / 読み方.
 */

.hakaru-instrument-selector {
  width: 100%;
  min-width: 0;
  color: #20372c;
}

.hakaru-instrument-current {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid
    rgba(23, 107, 76, 0.14);
  border-radius: 11px;
  color: #183c2b;
  background: #edf6f0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hakaru-instrument-current-label {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.hakaru-instrument-current-label small {
  color: #75847c;
  font-size: 9px;
  line-height: 1.3;
}

.hakaru-instrument-current-label strong {
  min-width: 0;
  color: #163f2d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.hakaru-instrument-current-action {
  flex: 0 0 auto;
  color: #176b4c;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
}

.hakaru-instrument-groups-container {
  min-width: 0;
}

.hakaru-instrument-selector-title {
  margin: 0 0 10px;
  color: #52635a;
  font-size: 11px;
  font-weight: 800;
}

.hakaru-instrument-groups {
  display: grid;
  gap: 15px;
  min-width: 0;
}

.hakaru-instrument-group {
  min-width: 0;
}

.hakaru-instrument-category {
  margin: 0 0 5px;
  color: #77857d;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.55;
}

.hakaru-instrument-list {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.hakaru-instrument-option,
button.hakaru-instrument-option,
a.hakaru-instrument-option {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  color: #30463b;
  background: transparent;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.hakaru-instrument-option:hover {
  color: #124d36;
  background: #edf5f0;
}

.hakaru-instrument-option.is-active,
button.hakaru-instrument-option.is-active,
a.hakaru-instrument-option.is-active {
  color: #104e37;
  background: #dcefe5;
}

.hakaru-instrument-option[hidden] {
  display: flex !important;
}

.hakaru-instrument-selector
.instrument-category-options {
  display: none !important;
}


/* ==================================================
   Desktop
   ================================================== */

@media (min-width: 721px) {
  .hakaru-instrument-current {
    display: none !important;
  }

  .hakaru-instrument-groups-container {
    display: block !important;
  }
}


/* ==================================================
   Mobile
   ================================================== */

@media (max-width: 720px) {
  .hakaru-instrument-current {
    display: flex;
  }

  .hakaru-instrument-groups-container {
    display: none !important;
    max-height: 55vh;
    overflow-y: auto;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid
      rgba(23, 107, 76, 0.12);
    border-radius: 11px;
    background: #ffffff;
  }

  .hakaru-instrument-selector.is-open
  .hakaru-instrument-groups-container {
    display: block !important;
  }

  .hakaru-instrument-selector-title {
    margin-bottom: 8px;
  }

  .hakaru-instrument-groups {
    gap: 13px;
  }

  .hakaru-instrument-option,
  button.hakaru-instrument-option,
  a.hakaru-instrument-option {
    min-height: 40px;
    padding: 8px 9px;
    font-size: 11px;
  }
}


/* ==================================================
   Guide layout integration
   ================================================== */

@media (max-width: 720px) {
  .hakaru-clean-guide-v1
  .guide-phase2-selector {
    display: block !important;
    margin-bottom: 8px;
  }
}
