/* Machine index mode and target add-ons.
   Base .machine-index-* layout is managed in the Cocoon child theme style.css. */
.machine-index [data-mode-panel] {
  display: none;
}

.machine-index-mode-title {
  margin: 0 0 6px;
  color: #1f2933;
  font-size: 1.24em;
  font-weight: 700;
  line-height: 1.35;
}

.machine-index[data-view-mode="all"] [data-mode-panel="all"],
.machine-index[data-view-mode="setting"] [data-mode-panel="setting"],
.machine-index[data-view-mode="tenjo"] [data-mode-panel="tenjo"] {
  display: grid;
}

.machine-index-normal,
.machine-index-card-link {
  grid-column: 1 / -1;
  grid-template-columns: inherit;
  gap: inherit;
  align-items: inherit;
  min-width: 0;
}

.machine-index-card-link,
.machine-index-name-link,
.machine-index-thumbnail-link {
  color: inherit;
  text-decoration: none;
}

.machine-index-thumbnail-link {
  display: block;
}

.machine-index-name-link {
  color: #1f2933;
}

.machine-index-name-link:hover,
.machine-index-name-link:focus-visible {
  color: #263f56;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.machine-index-thumbnail-link:focus-visible,
.machine-index-card-link:focus-visible {
  outline: 3px solid rgba(28, 101, 151, 0.35);
  outline-offset: 3px;
}

.machine-index-card-link {
  position: relative;
  margin: -14px -2px;
  padding: 14px 40px 14px 2px;
  border-radius: 8px;
}

.machine-index-card-link:hover .machine-index-name,
.machine-index-card-link:focus-visible .machine-index-name {
  color: #263f56;
}

.machine-index-card-link .machine-index-name {
  padding-right: 0;
}

.machine-index-card-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #60748a;
  font-size: 1.35em;
  line-height: 1;
  transform: translateY(-50%);
}

.machine-index .machine-index-link {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 7px;
}

.machine-index-match-reason {
  margin: -4px 0 7px;
  color: #60748a;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1.4;
}

.machine-index-match-reason[hidden] {
  display: none !important;
}

.machine-index-alias-group-title {
  margin: 14px 0 6px;
  padding: 0 0 5px;
  border-bottom: 1px solid #d9e0e8;
  color: #263f56;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.45;
}

.machine-index-setting-points {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  margin: -2px 0 0;
  color: #465566;
  font-size: 0.82em;
  line-height: 1.45;
}

.machine-index-setting-points-label {
  color: #263f56;
  font-weight: 700;
  white-space: nowrap;
}

.machine-index-setting-points-values {
  display: -webkit-box;
  flex: 1 1 220px;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.machine-index[data-view-mode="setting"] .machine-index-article-filter-set,
.machine-index[data-view-mode="tenjo"] .machine-index-article-filter-set {
  display: none;
}

.machine-index-target {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  margin: -2px 0 9px;
  color: #465566;
  font-size: 0.82em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.machine-index-target-label {
  color: #263f56;
  font-weight: 700;
  white-space: nowrap;
}

.machine-index-target-values {
  display: flex;
  flex: 1 1 220px;
  flex-wrap: wrap;
  gap: 3px 5px;
  min-width: 0;
}

.machine-index-target-condition {
  display: inline-flex;
  gap: 3px;
  align-items: baseline;
  max-width: 100%;
}

.machine-index-target-state {
  color: #66788a;
  font-weight: 700;
  white-space: nowrap;
}

.machine-index-target-separator {
  color: #8b99a8;
  font-weight: 700;
}

.machine-index-target strong {
  color: #233446;
  font-weight: 700;
}

@media screen and (max-width: 480px) {
  .machine-index-mode-title {
    margin-bottom: 10px;
    font-size: 1.06em;
    line-height: 1.35;
  }

  .machine-index-normal,
  .machine-index-card-link {
    grid-template-columns: inherit;
  }

  .machine-index .machine-index-link {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.78em;
  }

  .machine-index-card-link .machine-index-name {
    padding-right: 0;
  }

  .machine-index-card-link {
    margin: -11px -2px;
    padding: 11px 32px 11px 2px;
  }

  .machine-index-setting-points {
    gap: 3px 6px;
    font-size: 0.76em;
    line-height: 1.4;
  }

  .machine-index-match-reason {
    margin: 0 0 5px;
    font-size: 0.74em;
    line-height: 1.35;
  }

  .machine-index-alias-group-title {
    margin: 11px 0 4px;
    font-size: 0.88em;
    line-height: 1.4;
  }

  .machine-index-setting-points-label {
    flex-basis: 100%;
  }

  .machine-index-setting-points-values {
    flex-basis: 100%;
  }

  .machine-index-target {
    gap: 3px 6px;
    margin-bottom: 8px;
    font-size: 0.76em;
    line-height: 1.4;
  }

  .machine-index-target-label {
    flex-basis: 100%;
  }

  .machine-index-target-values {
    flex-basis: 100%;
    gap: 3px 4px;
  }

  .machine-index .machine-index-name {
    margin-bottom: 2px;
  }

  .machine-index .machine-index-target {
    margin-top: 0;
  }
}
